From 4350962f6f7c84dd6f5fbc80b721d011a4230339 Mon Sep 17 00:00:00 2001 From: "Mr.Wang" <281762391@qq.com> Date: Fri, 15 Jan 2016 22:07:55 +0800 Subject: [PATCH] =?UTF-8?q?[notic]=20[2]=20strpos():=20Empty=20needle=20/t?= =?UTF-8?q?hinkphp/library/think/Model.php=20=E7=AC=AC=201274=20=E8=A1=8C?= =?UTF-8?q?=20#209?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Model.php b/library/think/Model.php index e38ccd3b..7982b3c2 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1271,7 +1271,7 @@ class Model $table = preg_replace_callback("/__([A-Z0-9_-]+)__/sU", function ($match) use ($prefix) { return $prefix . strtolower($match[1]); }, $join); - } elseif (false === strpos($join, '(') && 0 !== strpos($join, $prefix)) { + } elseif (false === strpos($join, '(') && !empty($prefix) && 0 !== strpos($join, $prefix)) { // 传入的表名中不带有'('并且不以默认的表前缀开头时加上默认的表前缀 $table = $prefix . $join; } else {