Escape muted strings

This commit is contained in:
Karina Kwiatek 2021-12-22 19:33:19 +01:00
parent 18de468198
commit 249438e5a8
1 changed files with 1 additions and 1 deletions

View File

@ -2,6 +2,6 @@ class MuteRule < ApplicationRecord
belongs_to :user belongs_to :user
def applies_to?(post) def applies_to?(post)
!!(post.content =~ /\b#{muted_phrase}\b/i) !!(post.content =~ /\b#{Regexp.escape(muted_phrase)}\b/i)
end end
end end