diff options
| author | 2025-12-13 11:31:34 +0100 | |
|---|---|---|
| committer | 2025-12-13 11:31:34 +0100 | |
| commit | a8a544a2a205b42d2009b5c52d8939e8bc36263c (patch) | |
| tree | 27922ce7e14eec886cb0348aeb2501c3dceecf9c /app/Models/BooleanSearch.php | |
| parent | b66d4ade4160b0f13efa4fb48a6c27884ad81804 (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.php | 12 |
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('/:"(.*?)"/', ':"\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 . ')'; |
