mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-10 07:22:11 +05:30
Merge pull request #290 from sarciszewski/patch-1
Remove side-effects in hash_equals()
This commit is contained in:
commit
19b64c2e65
@ -128,9 +128,9 @@ class MAC extends AbstractTokenType implements TokenTypeInterface
|
||||
*/
|
||||
private function hash_equals($knownString, $userString)
|
||||
{
|
||||
if (!function_exists('hash_equals')) {
|
||||
function hash_equals($knownString, $userString)
|
||||
{
|
||||
if (function_exists('\hash_equals')) {
|
||||
return \hash_equals($knownString, $userString);
|
||||
}
|
||||
if (strlen($knownString) !== strlen($userString)) {
|
||||
return false;
|
||||
}
|
||||
@ -143,7 +143,3 @@ class MAC extends AbstractTokenType implements TokenTypeInterface
|
||||
return 0 === $result;
|
||||
}
|
||||
}
|
||||
|
||||
return hash_equals($knownString, $userString);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user