Skip to content

Commit be22b9e

Browse files
committed
Update Str::equals to be binary safe
1 parent 8af5303 commit be22b9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Str.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public static function endsWith(string $string, string $suffix, bool $caseSensit
6161
public static function equals(string $a, string $b, bool $caseSensitive = true): bool
6262
{
6363
if ($caseSensitive) {
64-
return $a === $b;
64+
return strcmp($a, $b) === 0;
6565
} else {
66-
return strtolower($a) === strtolower($b);
66+
return strcasecmp($a, $b) === 0;
6767
}
6868
}
6969
}

0 commit comments

Comments
 (0)