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)) {