mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-23 09:51:33 +01:00
FIX #7391
This commit is contained in:
@@ -5809,7 +5809,15 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
||||
$i3 = 0;
|
||||
foreach($tmpcrits as $tmpcrit)
|
||||
{
|
||||
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '') . $field . " LIKE '";
|
||||
$newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : '');
|
||||
|
||||
if (preg_match('/\.(id|rowid)$/', $field)) // Special cas for rowid that is sometimes a ref so used as a search field
|
||||
{
|
||||
$newres .= $field . " = " . (is_numeric(trim($tmpcrit))?trim($tmpcrit):'0');
|
||||
}
|
||||
else
|
||||
{
|
||||
$newres .= $field . " LIKE '";
|
||||
|
||||
$tmpcrit=trim($tmpcrit);
|
||||
$tmpcrit2=$tmpcrit;
|
||||
@@ -5832,6 +5840,8 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
|
||||
{
|
||||
$newres .= ' OR ' . $field . " IS NULL";
|
||||
}
|
||||
}
|
||||
|
||||
$i3++;
|
||||
}
|
||||
$i2++; // a criteria was added to string
|
||||
|
||||
Reference in New Issue
Block a user