aboutsummaryrefslogtreecommitdiff
path: root/app/Models/BooleanSearch.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-12-13 11:31:34 +0100
committerGravatar GitHub <noreply@github.com> 2025-12-13 11:31:34 +0100
commita8a544a2a205b42d2009b5c52d8939e8bc36263c (patch)
tree27922ce7e14eec886cb0348aeb2501c3dceecf9c /app/Models/BooleanSearch.php
parentb66d4ade4160b0f13efa4fb48a6c27884ad81804 (diff)
Fix search encoding and quoting (#8311)
Revised the encoding approach for searches: the HTML encoding is done just before its use for DB search. Fix also some cases with wrong quoting. Fix https://github.com/FreshRSS/FreshRSS/pull/8306#issuecomment-3643865439 Follow-up of https://github.com/FreshRSS/FreshRSS/pull/8293
Diffstat (limited to 'app/Models/BooleanSearch.php')
-rw-r--r--app/Models/BooleanSearch.php12
1 files changed, 1 insertions, 11 deletions
diff --git a/app/Models/BooleanSearch.php b/app/Models/BooleanSearch.php
index 68885cde8..e959f7af9 100644
--- a/app/Models/BooleanSearch.php
+++ b/app/Models/BooleanSearch.php
@@ -26,16 +26,6 @@ class FreshRSS_BooleanSearch implements \Stringable {
if ($input === '') {
return;
}
- if ($level === 0) {
- $input = preg_replace('/:&quot;(.*?)&quot;/', ':"\1"', $input);
- if (!is_string($input)) {
- return;
- }
- $input = preg_replace('/(?<=[\s(!-]|^)&quot;(.*?)&quot;/', '"\1"', $input);
- if (!is_string($input)) {
- return;
- }
- }
$this->raw_input = $input;
if ($level === 0) {
@@ -517,7 +507,7 @@ class FreshRSS_BooleanSearch implements \Stringable {
if ($part === '') {
continue;
}
- $operator = $search instanceof FreshRSS_BooleanSearch ? $search->operator() : 'OR';
+ $operator = $search instanceof FreshRSS_BooleanSearch ? $search->operator : 'OR';
if ((str_contains($part, ' ') || str_starts_with($part, '-')) && (count($this->searches) > 1 || in_array($operator, ['OR NOT', 'AND NOT'], true))) {
$part = '(' . $part . ')';