diff --git a/web/includes/Object.php b/web/includes/Object.php index f0e9b4cb9..2922673cc 100644 --- a/web/includes/Object.php +++ b/web/includes/Object.php @@ -98,9 +98,13 @@ class ZM_Object { if ( $value == null ) { $fields[] = '`'.$field.'` IS NULL'; } else if ( is_array($value) ) { - $func = function(){return '?';}; - $fields[] = '`'.$field.'` IN ('.implode(',', array_map($func, $value)). ')'; - $values += $value; + if ( count($value) ) { + $func = function(){return '?';}; + $fields[] = '`'.$field.'` IN ('.implode(',', array_map($func, $value)). ')'; + $values += $value; + } else { + return array(); + } } else { $fields[] = '`'.$field.'`=?';