From d53312174169f311714da389b6a36fe6a4bc8f9a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 20 Aug 2010 09:21:15 -0400 Subject: [PATCH] [ticket/9780] Add length check back to gen_rand_string(). PHPBB3-9780 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 980a26d525..36b9e18176 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -201,7 +201,7 @@ function set_config_count($config_name, $increment, $is_dynamic = false) function gen_rand_string($num_chars = 8) { // [a, z] + [0, 9] = 36 - return strtoupper(base_convert(unique_id(), 16, 36)); + return substr(strtoupper(base_convert(unique_id(), 16, 36)), 0, $num_chars); } /**