Skip to content

Commit

Permalink
Test for matches[operator]. Fixes #3607
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Oct 11, 2022
1 parent d6d3ce6 commit 6008946
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/api/app/Controller/Component/FilterComponent.php
Expand Up @@ -74,7 +74,7 @@ public function buildFilter($namedParams) {
if (preg_match('/^(?P<field>[a-z0-9]+)(?P<operator>.+)?$/i', $lhs, $matches) !== 1) {
throw new Exception('Invalid argument before `:`: ' . $lhs);
}
$operator = trim($matches['operator']);
$operator = isset($matches['operator']) ? trim($matches['operator']) : '';

// Only allow operators on our allow list. No operator
// specified defaults to `=` by cakePHP.
Expand Down

0 comments on commit 6008946

Please sign in to comment.