FilterQueryString: fix handling encoded <> signs

Those signs are URL-encoded and therefore not "seen" before decoding
the "key" part when the sit in front of the = sign. Same goes for
standalone ones. Fixed.
This commit is contained in:
Thomas Gelf 2014-06-20 13:06:07 +02:00
parent f2605b89ff
commit ecbdb07bea
1 changed files with 13 additions and 2 deletions

View File

@ -46,12 +46,23 @@ class FilterQueryString
protected function readNextExpression()
{
if ('' === ($key = $this->readNextKey())) {
return false;
}
$sign = $this->readChar();
foreach (array('<', '>') as $sign) {
if (false !== ($pos = strpos($key, $sign))) {
if ($this->nextChar() === '=') break;
$var = substr($key, $pos + 1);
$key = substr($key, 0, $pos);
return Filter::expression($key, $sign, $var);
}
}
if (in_array($this->nextChar(), array('=', '>', '<', '!'))) {
$sign = $this->readChar();
} else {
$sign = false;
}
if ($sign === false) {
return Filter::expression($key, '=', true);
}