FilterQueryString: fix parsing expression lists

The parser sometimes failed when reaching a=b&b=(c|d|e) - fixed.
This commit is contained in:
Thomas Gelf 2014-06-20 13:04:53 +02:00
parent 1ea15e1f66
commit f2605b89ff

View File

@ -32,13 +32,14 @@ class FilterQueryString
protected function readNextValue() protected function readNextValue()
{ {
$var = rawurldecode($this->readUnlessSpecialChar()); if ($this->nextChar() === '(') {
if ($var === '' && $this->nextChar() === '(') {
$this->readChar(); $this->readChar();
$var = preg_split('~\|~', $this->readUnless(')')); $var = preg_split('~\|~', $this->readUnless(')'));
if ($this->readChar() !== ')') { if ($this->readChar() !== ')') {
$this->parseError(null, 'Expected ")"'); $this->parseError(null, 'Expected ")"');
} }
} else {
$var = rawurldecode($this->readUnless(array(')', '&', '|', '>', '<')));
} }
return $var; return $var;
} }