Skip to content

Commit

Permalink
verify regex before saving
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Hoß <seb@xn--ho-hia.de>
  • Loading branch information
sebhoss committed Jan 6, 2025
1 parent cd6c547 commit 26bf846
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rss/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ async def set_filter(self, evt: MessageEvent, feed_id: int, title_exclude_filter
if not sub:
await evt.reply("This room is not subscribed to that feed")
return
try:
re.compile(title_exclude_filter)
except re.error:
await evt.reply(f"Filter is not a valid regular expression")
return
await self.dbm.update_title_filter(feed.id, evt.room_id, title_exclude_filter)
if title_exclude_filter:
await evt.reply(
Expand Down

0 comments on commit 26bf846

Please sign in to comment.