Skip to content
Snippets Groups Projects
Commit 4bfca795 authored by Demian Katz's avatar Demian Katz
Browse files

Advanced query detection is now more backslash-aware.

Resolves VUFIND-601.
parent 349545ba
Branches
Tags
No related merge requests found
...@@ -225,12 +225,13 @@ class QueryBuilder implements QueryBuilderInterface ...@@ -225,12 +225,13 @@ class QueryBuilder implements QueryBuilderInterface
$searchString = preg_replace('/"[^"]*"/', 'quoted', $searchString); $searchString = preg_replace('/"[^"]*"/', 'quoted', $searchString);
// Check for field specifiers: // Check for field specifiers:
if (preg_match("/[^\s]\:[^\s]/", $searchString)) { if (preg_match("/[^\s\\\]\:[^\s]/", $searchString)) {
return true; return true;
} }
// Check for parentheses and range operators: // Check for unescaped parentheses:
if (strstr($searchString, '(') && strstr($searchString, ')')) { $stripped = str_replace(array('\(', '\)'), '', $searchString);
if (strstr($stripped, '(') && strstr($stripped, ')')) {
return true; return true;
} }
$rangeReg = self::SOLR_RANGE_RE; $rangeReg = self::SOLR_RANGE_RE;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment