2
0
forked from Wavyzz/dolibarr

Natural search on numeric works also with several space after operator

This commit is contained in:
Laurent Destailleur
2015-03-10 10:14:24 +01:00
parent 2ea3eb3505
commit 35dfaf4dd1

View File

@@ -4961,7 +4961,7 @@ function natural_search($fields, $value, $numeric=0)
if ($numeric) if ($numeric)
{ {
$value=preg_replace('/([<>=]+)\s([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do $value=preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
} }
$crits = explode(' ', $value); $crits = explode(' ', $value);
$res = ''; $res = '';