mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-24 06:14:25 +02:00
Db\DbQuery: add NOT LIKE support
This commit is contained in:
parent
90f1ab06b4
commit
5ea2f33efb
@ -251,10 +251,12 @@ class DbQuery extends SimpleQuery
|
|||||||
if (is_array($expression) && $sign === '=') {
|
if (is_array($expression) && $sign === '=') {
|
||||||
// TODO: Should we support this? Doesn't work for blub*
|
// TODO: Should we support this? Doesn't work for blub*
|
||||||
return $col . ' IN (' . $this->escapeForSql($expression) . ')';
|
return $col . ' IN (' . $this->escapeForSql($expression) . ')';
|
||||||
} elseif (strpos($expression, '*') === false) {
|
} elseif ($sign === '=' && strpos($expression, '*') !== false) {
|
||||||
return $col . ' ' . $sign . ' ' . $this->escapeForSql($expression);
|
|
||||||
} else {
|
|
||||||
return $col . ' LIKE ' . $this->escapeForSql($this->escapeWildcards($expression));
|
return $col . ' LIKE ' . $this->escapeForSql($this->escapeWildcards($expression));
|
||||||
|
} elseif ($sign === '!=' && strpos($expression, '*') !== false) {
|
||||||
|
return $col . ' NOT LIKE ' . $this->escapeForSql($this->escapeWildcards($expression));
|
||||||
|
} else {
|
||||||
|
return $col . ' ' . $sign . ' ' . $this->escapeForSql($expression);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user