about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-06-05 21:38:04 -0500
committerGitHub <noreply@github.com>2018-06-05 21:38:04 -0500
commit68373e799bc6e289ba6c2ced5d0da376ad1cdb3a (patch)
treee5729bbe640156e20005bfc9b46a7527475c2c53 /app
parentf009fef40b78b31e9c34e85dca4629e32aa4daa0 (diff)
parenta640c322c19013647cbd19ac907dd18b57c2b1b8 (diff)
Merge pull request #534 from glitch-soc/restructure-kw-as-word-lists
Escape metacharacters in non-whole-word keyword mutes (#463, #533)
Diffstat (limited to 'app')
-rw-r--r--app/models/glitch/keyword_mute.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/glitch/keyword_mute.rb b/app/models/glitch/keyword_mute.rb
index e7cbbe617..7d0002afd 100644
--- a/app/models/glitch/keyword_mute.rb
+++ b/app/models/glitch/keyword_mute.rb
@@ -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