Skip to content

Commit

Permalink
Ensure = is removed from generated salt values.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 24, 2012
1 parent 064fef1 commit 24b68ec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Cake/Utility/Security.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ public static function rijndael($text, $key, $operation) {
* @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);
} }


/** /**
Expand Down

0 comments on commit 24b68ec

Please sign in to comment.