Index: branches/5.2.x/core/kernel/db/dbitem.php =================================================================== diff -u -N -r14699 -r14799 --- branches/5.2.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 14699) +++ branches/5.2.x/core/kernel/db/dbitem.php (.../dbitem.php) (revision 14799) @@ -1,6 +1,6 @@ $value) { - if ( !preg_match('/\./', $field) ) { - $ret .= '(`' . $this->TableName . '`.' . $field . ' = ' . $this->Conn->qstr($value) . ') AND '; - } - else { - $ret .= '(' . $field . ' = ' . $this->Conn->qstr($value) . ') AND '; - } + $value_part = is_null($value) ? ' IS NULL' : ' = ' . $this->Conn->qstr($value); + + $ret .= '(' . (strpos($field, '.') === false ? '`' . $this->TableName . '`.' : '') . $field . $value_part . ') AND '; } return substr($ret, 0, -5);