From 31793bb8dc46d1f1b43aba4a490a953664269add Mon Sep 17 00:00:00 2001 From: oldrind <1401019000@qq.com> Date: Wed, 13 Jan 2016 11:26:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3$val[0]=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=97=B6=E4=BC=9A=E5=BC=95=E5=8F=91=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/db/Driver.php b/library/think/db/Driver.php index b159ad2d..0e0e8937 100644 --- a/library/think/db/Driver.php +++ b/library/think/db/Driver.php @@ -402,7 +402,7 @@ abstract class Driver protected function parseSet($data) { foreach ($data as $key => $val) { - if (is_array($val) && 'exp' == $val[0]) { + if (isset($val[0]) && 'exp' == $val[0]) { $set[] = $this->parseKey($key) . '=' . $val[1]; } elseif (is_null($val)) { $set[] = $this->parseKey($key) . '=NULL'; @@ -880,7 +880,7 @@ abstract class Driver $this->model = $options['model']; $this->parseBind(!empty($options['bind']) ? $options['bind'] : []); foreach ($data as $key => $val) { - if (is_array($val) && 'exp' == $val[0]) { + if (isset($val[0]) && 'exp' == $val[0]) { $fields[] = $this->parseKey($key); $values[] = $val[1]; } elseif (is_null($val)) {