diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0ac5ea25bb0..31297c84a9a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13497,7 +13497,7 @@ function jsonOrUnserialize($stringtodecode) /** * forgeSQLFromUniversalSearchCriteria * - * @param string $filter String with universal search string. Must be '(aaa:bbb:ccc) OR (ddd:eeee:fff) ...' with + * @param ?string $filter String with universal search string. Must be '(aaa:bbb:ccc) OR (ddd:eeee:fff) ...' with * aaa is a field name (with alias or not) and * bbb is one of this operator '=', '<', '>', '<=', '>=', '!=', 'in', 'notin', 'like', 'notlike', 'is', 'isnot'. * ccc must not contains ( or ) @@ -13514,7 +13514,7 @@ function forgeSQLFromUniversalSearchCriteria($filter, &$errorstr = '', $noand = { global $db, $user; - if ($filter === '') { + if (is_null($filter) || $filter === '') { return ''; } if (!preg_match('/^\(.*\)$/', $filter)) { // If $filter does not start and end with ()