From 1afcaea4c6e97002e6819d3505f3e2ac4b398a55 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 6 Jan 2025 06:55:34 +0100 Subject: [PATCH] Trim quotes --- app/Support/Search/QueryParser/QueryParser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Support/Search/QueryParser/QueryParser.php b/app/Support/Search/QueryParser/QueryParser.php index 89e6e09ebb..c13332b88b 100644 --- a/app/Support/Search/QueryParser/QueryParser.php +++ b/app/Support/Search/QueryParser/QueryParser.php @@ -96,7 +96,7 @@ class QueryParser implements QueryParserInterface case '-': if ('' === $tokenUnderConstruction) { // A minus sign at the beginning of a token indicates prohibition - Log::debug('Indicate prohibition'); + // Log::debug('Indicate prohibition'); $prohibited = true; } if ('' !== $tokenUnderConstruction) { @@ -196,6 +196,8 @@ class QueryParser implements QueryParserInterface { if ('' !== $fieldName) { Log::debug(sprintf('Create FieldNode %s:%s (%s)', $fieldName, $token, var_export($prohibited, true))); + $token = ltrim($token, ':"'); + $token = rtrim($token, '"'); return new FieldNode(trim($fieldName), trim($token), $prohibited); }