mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Use hash_equals() function if it exists
This commit is contained in:
parent
dead538afb
commit
6a7b1e3fd2
1 changed files with 5 additions and 0 deletions
|
|
@ -292,6 +292,11 @@ class Security
|
|||
*/
|
||||
public static function compareStrings($a, $b)
|
||||
{
|
||||
if(function_exists('hash_equals'))
|
||||
{
|
||||
return hash_equals($a, $b);
|
||||
}
|
||||
|
||||
$diff = strlen($a) ^ strlen($b);
|
||||
$maxlen = min(strlen($a), strlen($b));
|
||||
for($i = 0; $i < $maxlen; $i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue