Filters: try to give meaningful results for...

...missing columns

refs #4787
This commit is contained in:
Thomas Gelf 2014-11-11 19:26:37 +01:00
parent 8987b69d55
commit 6d705721e3
2 changed files with 8 additions and 1 deletions

View File

@ -6,9 +6,12 @@ namespace Icinga\Data\Filter;
class FilterGreaterThan extends FilterExpression
{
public function matches($row)
{
if (! isset($row->{$this->column})) {
// TODO: REALLY? Exception?
return false;
}
return (string) $row->{$this->column} > (string) $this->expression;
}
}

View File

@ -8,6 +8,10 @@ class FilterMatch extends FilterExpression
{
public function matches($row)
{
if (! isset($row->{$this->column})) {
// TODO: REALLY? Exception?
return false;
}
$expression = (string) $this->expression;
if (strpos($expression, '*') === false) {
return (string) $row->{$this->column} === $expression;