From 1ea15e1f66572f24a6cd361152cdb54bdb486740 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 20 Jun 2014 13:02:02 +0200 Subject: [PATCH] FilterQueryString: fix sub-expression parsing In a string like !(b=c)&a=d the parser used to fail once it reached the &, fixed now. --- library/Icinga/Data/Filter/FilterQueryString.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Data/Filter/FilterQueryString.php b/library/Icinga/Data/Filter/FilterQueryString.php index e4fddfc58..07c4d4c4f 100644 --- a/library/Icinga/Data/Filter/FilterQueryString.php +++ b/library/Icinga/Data/Filter/FilterQueryString.php @@ -93,7 +93,7 @@ class FilterQueryString )); } - protected function readFilters($nestingLevel = 0, $op = '&') + protected function readFilters($nestingLevel = 0, $op = null) { $filters = array(); while ($this->pos < $this->length) { @@ -113,6 +113,11 @@ class FilterQueryString continue; } + if ($op === null && count($filters > 0) && ($next === '&' || $next === '|')) { + $op = $next; + $next = $this->readChar(); + } + if ($next === false) { // Nothing more to read break;