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:
parent
f2605b89ff
commit
ecbdb07bea
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue