mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +02:00
Fix operator in wildcard filter chains
This commit is contained in:
parent
214a34a5a8
commit
c8ed889114
@ -312,17 +312,19 @@ class DbQuery extends SimpleQuery
|
|||||||
if (! empty($comp)) {
|
if (! empty($comp)) {
|
||||||
$sql[] = $col . ' IN (' . $this->escapeForSql($comp) . ')';
|
$sql[] = $col . ' IN (' . $this->escapeForSql($comp) . ')';
|
||||||
}
|
}
|
||||||
|
$operator = 'OR';
|
||||||
} elseif ($sign === '!=') {
|
} elseif ($sign === '!=') {
|
||||||
if (! empty($comp)) {
|
if (! empty($comp)) {
|
||||||
$sql[] = sprintf('(%1$s NOT IN (%2$s) OR %1$s IS NULL)', $col, $this->escapeForSql($comp));
|
$sql[] = sprintf('(%1$s NOT IN (%2$s) OR %1$s IS NULL)', $col, $this->escapeForSql($comp));
|
||||||
}
|
}
|
||||||
|
$operator = 'AND';
|
||||||
} else {
|
} else {
|
||||||
throw new QueryException(
|
throw new QueryException(
|
||||||
'Unable to render array expressions with operators other than equal or not equal'
|
'Unable to render array expressions with operators other than equal or not equal'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return '(' . implode(' OR ', $sql) . ')';
|
return '(' . implode(" $operator ", $sql) . ')';
|
||||||
} elseif ($sign === '=' && strpos($expression, '*') !== false) {
|
} elseif ($sign === '=' && strpos($expression, '*') !== false) {
|
||||||
if ($expression === '*') {
|
if ($expression === '*') {
|
||||||
return new Zend_Db_Expr('TRUE');
|
return new Zend_Db_Expr('TRUE');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user