From bc9a6f3e16e304c5608eb336dbd8b68253a7fef2 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Mon, 16 Sep 2013 23:20:17 +0400 Subject: [PATCH] Better strtr arguments format --- framework/yii/helpers/SecurityBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/helpers/SecurityBase.php b/framework/yii/helpers/SecurityBase.php index 0ecad0f..5b192de 100644 --- a/framework/yii/helpers/SecurityBase.php +++ b/framework/yii/helpers/SecurityBase.php @@ -140,7 +140,7 @@ class SecurityBase 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); }