diff --git a/app/models/mute_rule.rb b/app/models/mute_rule.rb index 14cfabf2..b5b828b4 100644 --- a/app/models/mute_rule.rb +++ b/app/models/mute_rule.rb @@ -2,6 +2,6 @@ class MuteRule < ApplicationRecord belongs_to :user def applies_to?(post) - !!(post.content =~ /\b#{muted_phrase}\b/i) + !!(post.content =~ /\b#{Regexp.escape(muted_phrase)}\b/i) end end