From c9ab0cc72a7306f97cf7ca15fa1512fa0f2ec3f4 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 28 Apr 2016 14:36:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9Bwhere=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=AF=B9=E5=8E=9F=E7=94=9F=E6=9D=A1=E4=BB=B6=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 26ab13cc..ced89e49 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -491,7 +491,7 @@ class Query if (is_string($field) && !empty($this->options['via'])) { $field = $this->options['via'] . '.' . $field; } - if (is_string($field) && strpos($field, ' ')) { + if (is_string($field) && preg_match('/[,=\>\<\'\"\(`.\s]/', $field)) { $where[] = ['exp', $field]; if (is_array($op)) { // 参数绑定