Use strlen(). Comparing a string against a length will not do the right thing.

This commit is contained in:
mark_story 2016-05-03 17:27:16 -04:00
parent 8cd5a64c27
commit b6d631b987

View file

@ -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);