[icinga-checkins] icinga.org: icingaweb2/master: Fix that DbQuery:: renderFilter produces invalid filters

git at icinga.org git at icinga.org
Thu Nov 20 11:58:38 CET 2014


Module: icingaweb2
Branch: master
Commit: 38957e340ba713d90f4e89c2240a9503c06ae392
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=38957e340ba713d90f4e89c2240a9503c06ae392

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Thu Nov 20 11:58:22 2014 +0100

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 e89236d..bad1261 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) . ') ';



More information about the icinga-checkins mailing list