From 4e67e20393d944fa8c2afb48d8c4e7f26d91152b Mon Sep 17 00:00:00 2001 From: wangyidong Date: Mon, 5 Aug 2024 16:11:13 +0800 Subject: [PATCH] * [refac bug #53548] Adjust code. --- framework/base/control.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/base/control.class.php b/framework/base/control.class.php index c4c38caae2..122281afdc 100644 --- a/framework/base/control.class.php +++ b/framework/base/control.class.php @@ -1124,7 +1124,7 @@ class baseControl { if(!empty($data['message'])) echo js::alert($data['message']); $locate = $data['locate'] ?? $_SERVER['HTTP_REFERER'] ?? ''; - if($locate && preg_match('/\(/', $locate)) $locate = $this->config->webRoot; + if($locate && strpos($locate, '(') !== false) $locate = $this->config->webRoot; if(!empty($locate)) return helper::end(js::locate($locate)); return helper::end($data['message'] ?? 'success'); } @@ -1137,7 +1137,7 @@ class baseControl { echo js::alert($data['message']); $locate = $data['locate'] ?? $_SERVER['HTTP_REFERER'] ?? ''; - if($locate && preg_match('/\(/', $locate)) $locate = $this->config->webRoot; + if($locate && strpos($locate, '(') !== false) $locate = $this->config->webRoot; if (!empty($locate)) return helper::end(js::locate($locate)); return helper::end($data['message'] ?? 'fail'); }