From 4b12ea826015a3b9aee912f3597befa11f8752f2 Mon Sep 17 00:00:00 2001 From: thisgun Date: Mon, 13 Jun 2022 10:41:09 +0900 Subject: [PATCH] =?UTF-8?q?get=5Frandom=5Ftoken=5Fstring=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=20=EC=BD=94=EB=93=9C=20=EC=9E=AC=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index b873868df..7c1e0d26b 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -3951,10 +3951,7 @@ function get_random_token_string($length=6) } $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; - $characters_length = strlen($characters); - $output = ''; - for ($i = 0; $i < $length; $i++) - $output .= $characters[rand(0, $characters_length - 1)]; + $output = substr(str_shuffle($characters), 0, $length); // jihan001 님 제안코드로 수정 return bin2hex($output); }