Escape muted strings
This commit is contained in:
parent
18de468198
commit
249438e5a8
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue