From 8fe8034cf48e71c4ab9e82019f58120b3e5dcca2 Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 1 Mar 2022 14:15:21 +0800 Subject: [PATCH] * Fix bug#20175. --- module/search/lang/zh-cn.php | 2 +- module/search/model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/search/lang/zh-cn.php b/module/search/lang/zh-cn.php index c3e0a9a820..0b2c62b643 100644 --- a/module/search/lang/zh-cn.php +++ b/module/search/lang/zh-cn.php @@ -74,7 +74,7 @@ $lang->search->result = '搜索结果'; $lang->search->buildSuccessfully = '初始化搜索索引成功'; $lang->search->executeInfo = '为您找到相关结果%s个,耗时%s秒'; $lang->search->buildResult = "创建 %s 索引, 已创建 %s 条记录;"; -$lang->search->queryTips = "多个id可以使用英文逗号分隔"; +$lang->search->queryTips = "多个id可用英文逗号分隔"; $lang->search->modules['all'] = '全部'; $lang->search->modules['task'] = '任务'; diff --git a/module/search/model.php b/module/search/model.php index da9dc45a80..c78364c072 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -176,7 +176,7 @@ class searchModel extends model if($operator == 'between' and !isset($this->config->search->dynamic[$value])) $operator = '='; $condition = $operator . ' ' . $this->dbh->quote($value) . ' '; - if($operator == '=' and $this->post->$fieldName == 'id' and preg_match('/^[0-9]+(,[0-9]+)+/', $value) and !preg_match('/[\x7f-\xff]+/', $value)) + if($operator == '=' and $this->post->$fieldName == 'id' and preg_match('/^[0-9]+(,[0-9]+)+$/', $value) and !preg_match('/[\x7f-\xff]+/', $value)) { $values = explode(',', trim($this->dbh->quote($value), "'")); foreach($values as $value) $value = "'" . $value . "'";