Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure = is removed from generated salt values.

  • Loading branch information...
commit 24b68ec1db681fb371279c2a6313a9621f4832db 1 parent 064fef1
@markstory markstory authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/Cake/Utility/Security.php
View
7 lib/Cake/Utility/Security.php
@@ -222,7 +222,12 @@ public static function rijndael($text, $key, $operation) {
* @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);
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.