summaryrefslogtreecommitdiff
path: root/it_dbi.class
diff options
context:
space:
mode:
authorUrban Müller2017-05-17 16:55:34 +0200
committerUrban Müller2017-05-17 16:55:34 +0200
commitdda47207fcb7a2101048deaae3508c09f8b013e8 (patch)
treee3196bea39da67119558cf5b4e672be25c2481a4 /it_dbi.class
parent58a3d0a49c381af1845437f7c7da4051ab16aa76 (diff)
downloaditools-dda47207fcb7a2101048deaae3508c09f8b013e8.tar.gz
itools-dda47207fcb7a2101048deaae3508c09f8b013e8.tar.bz2
itools-dda47207fcb7a2101048deaae3508c09f8b013e8.zip
catch misnamed columns even when setting them to null
Diffstat (limited to 'it_dbi.class')
-rw-r--r--it_dbi.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it_dbi.class b/it_dbi.class
index f64eb4e..ee6d268 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -253,7 +253,7 @@ function _set($tags, $allfields = false)
$dyns[] = $this->escape_string(trim($field, "-")) . ", $value";
else if (substr($field, 0, 1) === '-') # Unquoted value (always added)
$result[] = substr($field, 1) . "=$value";
- else if ($allfields || (isset($value) && isset($this->_data[$field]) ? strval($value) !== strval($this->_data[$field]) : $value !== $this->_data[$field]))
+ else if ($allfields || (isset($value) && isset($this->_data[$field]) ? strval($value) !== strval($this->_data[$field]) : $value !== $this->_data[$field] || !array_key_exists($field, $this->_data)))
{
if ($this->_p['charset'] == "utf8") # NOTE: Mysql charset is simply utf8, not utf-8
$value = it::any2utf8($value, "error in db-field $field");