diff --git a/lib/Cake/Utility/Security.php b/lib/Cake/Utility/Security.php index 01ade1ef9..464d05f71 100644 --- a/lib/Cake/Utility/Security.php +++ b/lib/Cake/Utility/Security.php @@ -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);