mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Ensure = is removed from generated salt values.
This commit is contained in:
parent
064fef1a15
commit
24b68ec1db
1 changed files with 6 additions and 1 deletions
|
@ -222,7 +222,12 @@ class Security {
|
||||||
* @return string The generated salt
|
* @return string The generated salt
|
||||||
*/
|
*/
|
||||||
public static function salt($length = 22) {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue