Skip to content

Commit

Permalink
lib: Don't render empty filters to SQL
Browse files Browse the repository at this point in the history
Else we are presented with syntax errors.

fixes #9211
  • Loading branch information
lippserd committed May 22, 2015
1 parent 01b453e commit 83a6e85
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions library/Icinga/Data/Db/DbQuery.php
Expand Up @@ -166,10 +166,12 @@ protected function renderFilter($filter, $level = 0)
$parts[] = $filterPart;
}
}
if ($level > 0) {
$str .= ' (' . implode($op, $parts) . ') ';
} else {
$str .= implode($op, $parts);
if (! empty($parts)) {
if ($level > 0) {
$str .= ' (' . implode($op, $parts) . ') ';
} else {
$str .= implode($op, $parts);
}
}
}
} else {
Expand Down

0 comments on commit 83a6e85

Please sign in to comment.