Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 545910c

Browse files
committed
AJXP_Utils: Make sure to remove = from base64encoded string when generating random string.
1 parent aafd5fa commit 545910c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/core/classes/class.AJXP_Utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ public static function generateRandomString($length = 24, $complexChars = false)
19451945
if (function_exists('openssl_random_pseudo_bytes') && USE_OPENSSL_RANDOM && !$complexChars) {
19461946
$password = base64_encode(openssl_random_pseudo_bytes($length, $strong));
19471947
if($strong == TRUE)
1948-
return substr(str_replace(array("/","+"), "", $password), 0, $length); //base64 is about 33% longer, so we need to truncate the result
1948+
return substr(str_replace(array("/","+","="), "", $password), 0, $length); //base64 is about 33% longer, so we need to truncate the result
19491949
}
19501950

19511951
//fallback to mt_rand if php < 5.3 or no openssl available

0 commit comments

Comments
 (0)