From 38957e340ba713d90f4e89c2240a9503c06ae392 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 20 Nov 2014 11:58:22 +0100 Subject: [PATCH] Fix that DbQuery::renderFilter produces invalid filters fixes #7749 --- library/Icinga/Data/Db/DbQuery.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Data/Db/DbQuery.php b/library/Icinga/Data/Db/DbQuery.php index e89236df5..bad1261aa 100644 --- a/library/Icinga/Data/Db/DbQuery.php +++ b/library/Icinga/Data/Db/DbQuery.php @@ -162,7 +162,10 @@ class DbQuery extends SimpleQuery $parts = array(); if (! $filter->isEmpty()) { foreach ($filter->filters() as $f) { - $parts[] = $this->renderFilter($f, $level + 1); + $filterPart = $this->renderFilter($f, $level + 1); + if ($filterPart !== '') { + $parts[] = $filterPart; + } } if ($level > 0) { $str .= ' (' . implode($op, $parts) . ') ';