mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/13917] Use hash_equals() if it's available
PHPBB3-13917
This commit is contained in:
parent
db3782e491
commit
852337cacd
1 changed files with 6 additions and 0 deletions
|
@ -153,6 +153,12 @@ class helper
|
|||
*/
|
||||
public function string_compare($string_a, $string_b)
|
||||
{
|
||||
// Use hash_equals() if it's available
|
||||
if (function_exists('hash_equals'))
|
||||
{
|
||||
return hash_equals($string_a, $string_b);
|
||||
}
|
||||
|
||||
$difference = strlen($string_a) != strlen($string_b);
|
||||
|
||||
for ($i = 0; $i < strlen($string_a) && $i < strlen($string_b); $i++)
|
||||
|
|
Loading…
Add table
Reference in a new issue