From f858668ad4c5fc38bac149c21119bd7fa73c9e1e Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 19 May 2022 22:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=AF=86=E5=87=BD=E6=95=B0php8?= =?UTF-8?q?=E4=B8=8B=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/common.php b/app/common.php index 44e2c5f12..d74c47d1c 100755 --- a/app/common.php +++ b/app/common.php @@ -2608,7 +2608,8 @@ function Authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) // substr($result, 0, 10) - time() > 0 验证数据有效性 // substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16) 验证数据完整性 // 验证数据有效性,请看未加密明文的格式 - if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) { + if($result !== '' && $result !== null && (substr($result, 0, 10) == 0 || intval(substr($result, 0, 10)) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) + { return substr($result, 26); } else { return '';