From a8a544a2a205b42d2009b5c52d8939e8bc36263c Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 13 Dec 2025 11:31:34 +0100 Subject: 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 --- app/Models/BooleanSearch.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'app/Models/BooleanSearch.php') 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('/:"(.*?)"/', ':"\1"', $input); - if (!is_string($input)) { - return; - } - $input = preg_replace('/(?<=[\s(!-]|^)"(.*?)"/', '"\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 . ')'; -- cgit v1.2.3