1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 08:17:12 +02:00
This commit is contained in:
Ryan Cramer
2021-10-04 10:56:12 -04:00
parent 68bd38d1c9
commit f61feb56fd

View File

@@ -337,12 +337,13 @@ class ProcessPageSearch extends Process implements ConfigurableModule {
} else {
$operator = substr($name, -1) . '=';
if(isset($this->operators[$operator])) {
$name = substr($name, 0, -1);
} else {
$operator = '=';
$operator = '=';
$operatorChars = preg_quote(implode('', Selectors::getOperatorChars()));
if(preg_match('/^(.+?)([' . $operatorChars . ']+)$/', $name, $matches)) {
$name = $matches[1];
$operator = $matches[2] . '=';
// if unsupported operator requested, substitute '='
if(!isset($this->operators[$operator])) $operator = '=';
}
}