Fix error "explode(): Argument #2 ($string) must be of type string, array given", happens sometimes while merging contacts

This commit is contained in:
Hadi Nategh 2022-03-22 10:54:44 +01:00
parent 2bf05f23f2
commit 6b1dd6a5fd

View File

@ -1123,7 +1123,7 @@ class Base
$criteria[$col] = substr($criteria[$col],1);
$negate = true;
}
foreach(explode(' ',$criteria[$col]) as $crit)
foreach((is_array($criteria[$col]) ? $criteria[$col] : explode(' ',$criteria[$col])) as $crit)
{
$query[] = ($negate ? ' ('.$table_name.$db_col.' IS NULL OR ' : '').$table_name.$db_col.$cmp_op.
$this->db->quote($wildcard.str_replace(array('%','_','*','?'),array('\\%','\\_','%','_'),$crit).$wildcard).