From 9ea4208579749088028ccbf5e604e4de3435c623 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 11 Dec 2015 22:30:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3quote=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/db/driver.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/db/driver.php b/library/think/db/driver.php index 0fdc6460..780787fb 100644 --- a/library/think/db/driver.php +++ b/library/think/db/driver.php @@ -153,7 +153,7 @@ abstract class Driver $this->queryStr = $str; if (!empty($this->bind)) { $that = $this; - $this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {return '\'' . $that->escapeString($val) . '\'';}, $this->bind)); + $this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {return $that->escapeString($val);}, $this->bind)); } if ($fetchSql) { return $this->queryStr; @@ -213,7 +213,7 @@ abstract class Driver $this->queryStr = $str; if (!empty($this->bind)) { $that = $this; - $this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {return '\'' . $that->escapeString($val) . '\'';}, $this->bind)); + $this->queryStr = strtr($this->queryStr, array_map(function ($val) use ($that) {return $that->escapeString($val);}, $this->bind)); } if ($fetchSql) { return $this->queryStr; @@ -454,7 +454,7 @@ abstract class Driver protected function parseValue($value) { if (is_string($value)) { - $value = strpos($value, ':') === 0 && in_array($value, array_keys($this->bind)) ? $this->escapeString($value) : '\'' . $this->escapeString($value) . '\''; + $value = strpos($value, ':') === 0 && in_array($value, array_keys($this->bind)) ? $value : $this->escapeString($value); } elseif (isset($value[0]) && is_string($value[0]) && strtolower($value[0]) == 'exp') { $value = $this->escapeString($value[1]); } elseif (is_array($value)) {