FilterQueryString: fix sub-expression parsing

In a string like !(b=c)&a=d the parser used to fail once it reached
the &, fixed now.
This commit is contained in:
Thomas Gelf 2014-06-20 13:02:02 +02:00
parent a3a2e97f18
commit 1ea15e1f66
1 changed files with 6 additions and 1 deletions

View File

@ -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;