From 1805404b00673c1dcc3dc298d8a2187c82fc29c6 Mon Sep 17 00:00:00 2001 From: Kyle Huynh <7862086+kylehuynh205@users.noreply.github.com> Date: Thu, 9 Mar 2023 09:30:16 -0500 Subject: [PATCH] Update AdvancedSearchQueryTerm.php Fixed the use case: quoted keywords cotain \ --- src/AdvancedSearchQueryTerm.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/AdvancedSearchQueryTerm.php b/src/AdvancedSearchQueryTerm.php index da03f8a..b5aa2d8 100644 --- a/src/AdvancedSearchQueryTerm.php +++ b/src/AdvancedSearchQueryTerm.php @@ -309,8 +309,15 @@ class AdvancedSearchQueryTerm { $value = "!" . str_replace('"', "", trim($value)); } else { - // one word - $value = str_replace('"', "", trim($value)); + // Case 2: keywords is one word + // if there is quotation (with backslash) surrounded, + if (strpos(trim($value), '\"' ) !== false) { + $value = str_replace('\"', "", trim($value)); + } + else { + // if there is quotation (without backslash) surrounded + $value = str_replace('"', "", trim($value)); + } } return $value; }