fix(filters): treat phrases as literal text in the regex

Phrases went into the Postgres and Elixir regexes as they were, so a
phrase like "(" broke the timeline and notification queries. The :re
form also put the word boundaries only around the whole alternation.

Escape each phrase and, as Mastodon does, add a word boundary only where
the phrase starts or ends with a word character.

Reported in Akkoma (d6209837b).
This commit is contained in:
Lain Soykaf 2026-10-27 12:28:52 +04:00
commit f975db8719
No known key found for this signature in database
3 changed files with 66 additions and 6 deletions

View file

@ -0,0 +1 @@
Treat filter phrases as literal text; a phrase like "(" no longer breaks timeline and notification queries, and phrases that start or end with punctuation (like "#tag") now match