Skip to content

Commit

Permalink
Better strtr arguments format
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Sep 16, 2013
1 parent ad479dd commit bc9a6f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/yii/helpers/SecurityBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public static function getSecretKey($name, $length = 32)
public static function generateRandomKey($length = 32)
{
if (function_exists('openssl_random_pseudo_bytes')) {
$key = strtr(base64_encode(openssl_random_pseudo_bytes($length, $strong)), array('+' => '_', '/' => '-', '=' => '.'));
$key = strtr(base64_encode(openssl_random_pseudo_bytes($length, $strong)), '+/=', '_-.');
if ($strong) {
return substr($key, 0, $length);
}
Expand Down

0 comments on commit bc9a6f3

Please sign in to comment.