Skip to content

Commit

Permalink
Fix fatal error with bad parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 2, 2024
1 parent b5730db commit 11ea0ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -13319,7 +13319,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 )
Expand All @@ -13336,7 +13336,7 @@ function forgeSQLFromUniversalSearchCriteria($filter, &$errorstr = '', $noand =
{
global $db, $user;

if (is_null($filter) || is_array($filter) || $filter === '') {
if (is_null($filter) || !is_string($filter) || $filter === '') {
return '';
}
if (!preg_match('/^\(.*\)$/', $filter)) { // If $filter does not start and end with ()
Expand Down

0 comments on commit 11ea0ad

Please sign in to comment.