Update AdvancedSearchQueryTerm.php

Fixed the use case: quoted keywords cotain \
This commit is contained in:
Kyle Huynh 2023-03-09 09:30:16 -05:00 committed by GitHub
parent 4822f74362
commit 1805404b00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -309,9 +309,16 @@ class AdvancedSearchQueryTerm {
$value = "!" . str_replace('"', "", trim($value));
}
else {
// one word
// 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;
}
else {