Fix: Add not in operator

This commit is contained in:
Dev2a
2023-12-27 15:48:41 +01:00
parent 1f4002d601
commit 91f5cae071

View File

@@ -12593,20 +12593,22 @@ function dolForgeCriteriaCallback($matches)
$operator = strtoupper(preg_replace('/[^a-z<>!=]/i', '', trim($tmp[1])));
if ($operator == 'NOTLIKE') {
$operator = 'NOT LIKE';
}
if ($operator == 'ISNOT') {
$operator = 'IS NOT';
}
if ($operator == '!=') {
$operator = '<>';
$realOperator = [
'NOTLIKE' => 'NOT LIKE',
'ISNOT' => 'IS NOT',
'NOTIN' => 'NOT IN',
'!=' => '<>',
];
if (array_key_exists($operator, $realOperator)) {
$operator = $realOperator[$operator];
}
$tmpescaped = $tmp[2];
$regbis = array();
if ($operator == 'IN') { // IN is allowed for list of ID or code only
if ($operator == 'IN' || $operator == 'NOT IN') { // IN is allowed for list of ID or code only
//if (!preg_match('/^\(.*\)$/', $tmpescaped)) {
$tmpescaped2 = '(';
// Explode and sanitize each element in list