Fix filter using !=
This commit is contained in:
parent
081ede08ec
commit
5ef4aa78e9
1 changed files with 3 additions and 3 deletions
|
|
@ -9768,7 +9768,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||
$value = preg_replace('/\*/', '%', $value); // Replace * with %
|
||||
}
|
||||
if ($mode == 1) {
|
||||
$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
|
||||
}
|
||||
|
||||
$value = preg_replace('/\s*\|\s*/', '|', $value);
|
||||
|
|
@ -9788,10 +9788,10 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
|
|||
foreach ($fields as $field) {
|
||||
if ($mode == 1) {
|
||||
$operator = '=';
|
||||
$newcrit = preg_replace('/([<>=]+)/', '', $crit);
|
||||
$newcrit = preg_replace('/([!<>=]+)/', '', $crit);
|
||||
|
||||
$reg = array();
|
||||
preg_match('/([<>=]+)/', $crit, $reg);
|
||||
preg_match('/([!<>=]+)/', $crit, $reg);
|
||||
if (!empty($reg[1])) {
|
||||
$operator = $reg[1];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue