Ensure = is removed from generated salt values.

This commit is contained in:
mark_story 2012-08-24 09:35:33 -04:00
parent 064fef1a15
commit 24b68ec1db

View file

@ -222,7 +222,12 @@ class Security {
* @return string The generated salt
*/
public static function salt($length = 22) {
return substr(str_replace('+', '.', base64_encode(sha1(uniqid(Configure::read('Security.salt'), true), true))), 0, $length);
$salt = str_replace(
array('+', '='),
'.',
base64_encode(sha1(uniqid(Configure::read('Security.salt'), true), true))
);
return substr($salt, 0, $length);
}
/**