From 27757c1e5905fe4dd30f53e93071bbea689a816a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 27 Sep 2022 14:40:13 -0400 Subject: [PATCH] return empty array when passing empty as SQLvalue --- web/includes/Object.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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.'`=?';