mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Use strlen(). Comparing a string against a length will not do the right thing.
This commit is contained in:
parent
8cd5a64c27
commit
b6d631b987
1 changed files with 1 additions and 1 deletions
|
@ -191,7 +191,7 @@ class Security {
|
|||
E_USER_WARNING
|
||||
);
|
||||
$bytes = '';
|
||||
while ($bytes < $length) {
|
||||
while (strlen($bytes) < $length) {
|
||||
$bytes .= static::hash(CakeText::uuid() . uniqid(mt_rand(), true), 'sha512', true);
|
||||
}
|
||||
return substr($bytes, 0, $length);
|
||||
|
|
Loading…
Reference in a new issue