From dda47207fcb7a2101048deaae3508c09f8b013e8 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 17 May 2017 16:55:34 +0200 Subject: catch misnamed columns even when setting them to null --- it_dbi.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- cgit v1.2.3