diff options
| author | 2023-09-05 17:33:38 +0200 | |
|---|---|---|
| committer | 2023-09-05 17:33:38 +0200 | |
| commit | 2e1d45a88d2cfd439f4f9e7d92ca9c8cbdb39466 (patch) | |
| tree | 7953ca9e234c5c9c38eaa671cf00568a376d72a1 /app/Models/Search.php | |
| parent | 1c7c1016f4a5147003ed1c438b8a386a63a53cab (diff) | |
Fix parenthesis escaping bug (#5633)
fix https://github.com/FreshRSS/FreshRSS/issues/5632
In the SQL search, parentheses should not be escaped. Escaped parenthesis in the SQL search were tolerated by PostgreSQL but not by SQLite.
Diffstat (limited to 'app/Models/Search.php')
| -rw-r--r-- | app/Models/Search.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/Models/Search.php b/app/Models/Search.php index 52b000344..404b8bfac 100644 --- a/app/Models/Search.php +++ b/app/Models/Search.php @@ -73,6 +73,7 @@ class FreshRSS_Search { public function __construct(string $input) { $input = self::cleanSearch($input); + $input = self::unescape($input); $this->raw_input = $input; $input = $this->parseNotEntryIds($input); @@ -662,4 +663,9 @@ class FreshRSS_Search { } return trim($input); } + + /** Remove escaping backslashes for parenthesis logic */ + private static function unescape(string $input): string { + return str_replace(['\\(', '\\)'], ['(', ')'], $input); + } } |
