From 4a3cfebadd408425660574b2ac49e8d9f4f1d943 Mon Sep 17 00:00:00 2001 From: xiaomlove <353856593@qq.com> Date: Tue, 1 Jun 2021 16:48:40 +0800 Subject: [PATCH] prefix sub --- include/constants.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/constants.php b/include/constants.php index 1092eeba..c05ea261 100644 --- a/include/constants.php +++ b/include/constants.php @@ -20,6 +20,7 @@ if (!defined('REQUEST_ID')) { $requestId = $_SERVER['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)); } define('REQUEST_ID', $requestId);