From 8d56189d4e8014af4ab92e80aa7a8aaf6986f62f Mon Sep 17 00:00:00 2001 From: liufumingren Date: Thu, 22 Oct 2026 14:05:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(chat):=20=E4=BF=AE=E6=AD=A3=20preg=5Fmatch?= =?UTF-8?q?=20=E5=AD=97=E7=AC=A6=E7=B1=BB=E9=9D=9E=E6=B3=95=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E5=AF=BC=E8=87=B4=20PHP=207.4=20=E4=B8=8B=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [\s-_] 中 - 被当作范围连接符,PCRE2(PHP 7.3+,7.4 更严格)会报 invalid range in character class,导致 getPostNums 的手机号+分机号 过滤规则失效并产生 warning。改为 [\s\-_],语义不变。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- application/index/controller/wms/Chat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/index/controller/wms/Chat.php b/application/index/controller/wms/Chat.php index 3e2f572..a422512 100644 --- a/application/index/controller/wms/Chat.php +++ b/application/index/controller/wms/Chat.php @@ -1718,7 +1718,7 @@ _________________________________________________________ // 4. 排除手机号+分机号的变体(包含空格、括号等) // 如:13800138000 ext123、13800138000(123) - if (preg_match('/^1\d{10}[\s-_]?(ext|extension|x)[\s-_]?\d+$/i', $item)) { + if (preg_match('/^1\d{10}[\s\-_]?(ext|extension|x)[\s\-_]?\d+$/i', $item)) { return false; }