Skip to content

Commit

Permalink
filter: Fix that leading and trailing whitespaces for columns and exp…
Browse files Browse the repository at this point in the history
…ressions let filters fail

Before, filtering for "host = localhost" issued "got invalid column host".
  • Loading branch information
lippserd committed Oct 1, 2014
1 parent 1c7eb0d commit 46078f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/Icinga/Data/Filter/Filter.php
Expand Up @@ -131,6 +131,8 @@ public static function where($col, $filter)

public static function expression($col, $op, $expression)
{
$col = trim($col);
$expression = trim($expression);
switch ($op) {
case '=': return new FilterMatch($col, $op, $expression);
case '<': return new FilterLessThan($col, $op, $expression);
Expand Down

0 comments on commit 46078f5

Please sign in to comment.