forked from Wavyzz/dolibarr
FIX avoid the return "AND (())" (#30829)
This commit is contained in:
@@ -12546,6 +12546,10 @@ function jsonOrUnserialize($stringtodecode)
|
||||
*/
|
||||
function forgeSQLFromUniversalSearchCriteria($filter, &$errorstr = '', $noand = 0, $nopar = 0, $noerror = 0)
|
||||
{
|
||||
if (empty($filter)) {
|
||||
return ''; // to avoid the return "AND (())"
|
||||
}
|
||||
|
||||
if (!preg_match('/^\(.*\)$/', $filter)) { // If $filter does not start and end with ()
|
||||
$filter = '(' . $filter . ')';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user