diff options
| author | 2025-12-23 11:58:51 +0100 | |
|---|---|---|
| committer | 2025-12-23 11:58:51 +0100 | |
| commit | 6d57a9de47be4bb80a2121b6c4b8ebf278b93d70 (patch) | |
| tree | 6cba47ef73451a678d9fd152fa385ac75c02460f /tests/app/Models/SearchTest.php | |
| parent | cf3ca7076566909bd5b6eb519036f8d1b857f356 (diff) | |
Fix parsing of literal "or" in regex (#8338)
fix https://github.com/FreshRSS/FreshRSS/issues/7879
Diffstat (limited to 'tests/app/Models/SearchTest.php')
| -rw-r--r-- | tests/app/Models/SearchTest.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php index fad5d4768..213fdde45 100644 --- a/tests/app/Models/SearchTest.php +++ b/tests/app/Models/SearchTest.php @@ -790,6 +790,21 @@ final class SearchTest extends \PHPUnit\Framework\TestCase { '((e.title LIKE ? OR e.content LIKE ?) )', ['%https://example.net/test/%', '%https://example.net/test/%'] ], + [ // Regex with literal 'or' + 'intitle:/^A or B/i', + '(e.title ~* ? )', + ['^A or B'] + ], + [ // Regex with literal 'OR' + 'intitle:/^A B OR C D/i OR intitle:/^A B OR C D/i', + '(e.title ~* ? ) OR (e.title ~* ? )', + ['^A B OR C D', '^A B OR C D'] + ], + [ // Quote with literal 'OR' + 'intitle:"A B OR C D" OR intitle:"E or F"', + '(e.title LIKE ? ) OR (e.title LIKE ? )', + ['%A B OR C D%', '%E or F%'] + ], ]; } @@ -997,6 +1012,14 @@ final class SearchTest extends \PHPUnit\Framework\TestCase { '-intitle:a -inurl:b', '-intitle:a -inurl:b', ], + [ + 'intitle:/^A or B/i', + 'intitle:/^A or B/i', + ], + [ + 'intitle:/^A B OR C D/i', + 'intitle:/^A B OR C D/i', + ], ]; } |
