From fc66d40387c6e7b6cf5e0dd15f9b5c34de9e50d8 Mon Sep 17 00:00:00 2001 From: ThinkPHP Date: Tue, 30 Apr 2013 10:52:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BThink/Db/Driver=E7=B1=BB?= =?UTF-8?q?=E7=9A=84parseSet=E5=92=8Cinsert=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Think/Db/Driver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Think/Db/Driver.php b/Library/Think/Db/Driver.php index facfe284..293fa164 100644 --- a/Library/Think/Db/Driver.php +++ b/Library/Think/Db/Driver.php @@ -334,7 +334,7 @@ abstract class Driver { foreach ($data as $key=>$val){ if(is_scalar($val)) {// 过滤非标量数据 if(0===strpos($val,':')){ - $set[] = $this->parseKey($key).'='.$this->parseValue($val); + $set[] = $this->parseKey($key).'='.$this->escapeString($val); }else{ $name = count($this->bind); $set[] = $this->parseKey($key).'=:'.$name; @@ -752,7 +752,7 @@ abstract class Driver { if(is_scalar($val)) { // 过滤非标量数据 $fields[] = $this->parseKey($key); if(0===strpos($val,':')){ - $values[] = $this->parseValue($val); + $values[] = $this->escapeString($val); }else{ $name = count($this->bind); $values[] = ':'.$name;