From 545910c411b8cd18a2682d4bf0f83891156fe7e8 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Tue, 7 Apr 2015 11:20:44 +0200 Subject: [PATCH] AJXP_Utils: Make sure to remove = from base64encoded string when generating random string. --- core/src/core/classes/class.AJXP_Utils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/core/classes/class.AJXP_Utils.php b/core/src/core/classes/class.AJXP_Utils.php index fd64bac497..6a276278ac 100644 --- a/core/src/core/classes/class.AJXP_Utils.php +++ b/core/src/core/classes/class.AJXP_Utils.php @@ -1945,7 +1945,7 @@ public static function generateRandomString($length = 24, $complexChars = false) if (function_exists('openssl_random_pseudo_bytes') && USE_OPENSSL_RANDOM && !$complexChars) { $password = base64_encode(openssl_random_pseudo_bytes($length, $strong)); if($strong == TRUE) - return substr(str_replace(array("/","+"), "", $password), 0, $length); //base64 is about 33% longer, so we need to truncate the result + return substr(str_replace(array("/","+","="), "", $password), 0, $length); //base64 is about 33% longer, so we need to truncate the result } //fallback to mt_rand if php < 5.3 or no openssl available