Update functions.lib.php

This commit is contained in:
Laurent Destailleur
2018-04-11 17:37:00 +02:00
committed by GitHub
parent 8a0baaad17
commit 1aace69b1a

View File

@@ -6739,10 +6739,11 @@ function natural_search($fields, $value, $mode=0, $nofirstand=0)
{
if ($val)
{
$newres .= ($i2 > 0 ? ' OR ' : '') . $field . ' LIKE \'' . $db->escape(trim($val)) . ',%\'';
$newres .= ($i2 > 0 ? ' OR (' : '(') . $field . ' LIKE \'' . $db->escape(trim($val)) . ',%\'';
$newres .= ' OR '. $field . ' = \'' . $db->escape(trim($val)) . '\'';
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . '\'';
$newres .= ' OR '. $field . ' LIKE \'%,' . $db->escape(trim($val)) . ',%\'';
$newres .= ')';
$i2++;
}
}