Merge pull request #534 from glitch-soc/restructure-kw-as-word-lists
Escape metacharacters in non-whole-word keyword mutes (#463, #533)
This commit is contained in:
@@ -50,7 +50,7 @@ class Glitch::KeywordMute < ApplicationRecord
|
||||
end
|
||||
|
||||
def matches?(str)
|
||||
str =~ (whole_word ? boundary_regex_for_keyword : /#{keyword}/i)
|
||||
str =~ (whole_word ? boundary_regex_for_keyword : /#{Regexp.escape(keyword)}/i)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user