From c73c5f9ab115826bc9dcf027bd4b470ed92c29aa Mon Sep 17 00:00:00 2001 From: xiaomlove <353856593@qq.com> Date: Tue, 1 Jun 2021 16:56:22 +0800 Subject: [PATCH] rquest_id length 32 --- include/constants.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/constants.php b/include/constants.php index c05ea261..c4db6487 100644 --- a/include/constants.php +++ b/include/constants.php @@ -21,7 +21,8 @@ if (!defined('REQUEST_ID')) { } else { $prefix = ($_SERVER['SCRIPT_FILENAME'] ?? '') . implode('', $_SERVER['argv'] ?? []); $prefix = substr(md5($prefix), 0, 5); - $requestId = bin2hex(random_bytes(11)) . str_replace('.', '', substr(uniqid($prefix, true), 12, 10)); + $requestId = bin2hex(random_bytes(11)) . substr(uniqid($prefix, true), 12); + $requestId = substr(str_replace('.', '', $requestId), 0, 32); } define('REQUEST_ID', $requestId); }