From 8fa67e9e3f38485b05144947e15a5c7756662931 Mon Sep 17 00:00:00 2001 From: zero Date: Thu, 5 Apr 2007 08:15:47 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@980 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/db/DBSqlite3_pdo.class.php | 8 +++----- classes/xml/XmlQueryParser.class.php | 2 +- modules/editor/queries/updateComponent.xml | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/classes/db/DBSqlite3_pdo.class.php b/classes/db/DBSqlite3_pdo.class.php index 5ba72f575..85b1e66dd 100644 --- a/classes/db/DBSqlite3_pdo.class.php +++ b/classes/db/DBSqlite3_pdo.class.php @@ -366,11 +366,9 @@ foreach($column as $key => $val) { // args에 아예 해당 key가 없으면 패스 if(!isset($args->{$key})) continue; - if(in_array($key, $pass_quotes)) $update_list[] = sprintf('`%s` = %s', $key, $this->addQuotes($val)); - else { - if(is_numeric($val)) $update_list[] = sprintf('`%s` = %s', $key, $val); - else $update_list[] = sprintf('`%s` = \'%s\'', $key, $this->addQuotes($val)); - } + $val = $this->addQuotes($val); + if(is_numeric($val) || in_array($key, $pass_quotes)) $update_list[] = sprintf('`%s` = %s', $key, $val); + else $update_list[] = sprintf('`%s` = \'%s\'', $key, $this->addQuotes($val)); } if(!count($update_list)) return; $update_query = implode(',',$update_list); diff --git a/classes/xml/XmlQueryParser.class.php b/classes/xml/XmlQueryParser.class.php index 3249aa42f..af4054da9 100644 --- a/classes/xml/XmlQueryParser.class.php +++ b/classes/xml/XmlQueryParser.class.php @@ -91,7 +91,7 @@ * @brief column, condition등의 key에 default 값을 세팅 **/ function _getDefaultCode($name, $value) { - if(!isset($value)) return; + if($value == NULL) return; if(substr($value, -1)!=')') return sprintf('if(!$args->%s) $args->%s = \'%s\';'."\n", $name, $name, $value); $str_pos = strpos($value, '('); diff --git a/modules/editor/queries/updateComponent.xml b/modules/editor/queries/updateComponent.xml index 94674e80c..968454dda 100644 --- a/modules/editor/queries/updateComponent.xml +++ b/modules/editor/queries/updateComponent.xml @@ -3,9 +3,9 @@ - + - +