Commit bc9a6f3e by Alexander Makarov

Better strtr arguments format

parent ad479dd7
...@@ -140,7 +140,7 @@ class SecurityBase ...@@ -140,7 +140,7 @@ class SecurityBase
public static function generateRandomKey($length = 32) public static function generateRandomKey($length = 32)
{ {
if (function_exists('openssl_random_pseudo_bytes')) { 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) { if ($strong) {
return substr($key, 0, $length); return substr($key, 0, $length);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment