about summary refs log tree commit diff
path: root/app/models/glitch
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-06-12 16:39:30 -0500
committerDavid Yip <yipdw@member.fsf.org>2018-06-12 16:39:30 -0500
commite931cf656d1de6d89b5b048d8f1de15be7b52690 (patch)
treeb1c0c66b6a88b56c422ea8be1dbef77e42afae72 /app/models/glitch
parent97d2df77aae687c983c1294ebcd3962e4f9d985c (diff)
parent34f1fd2a621ca869c17009487e2f10063812fbd0 (diff)
Merge remote-tracking branch 'glitchsoc/master' into 454-allow-keyword-mutes-to-skip-mentions
  Conflicts:
 	app/models/glitch/keyword_mute.rb
Diffstat (limited to 'app/models/glitch')
-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 11b7958f6..49769cb73 100644
--- a/app/models/glitch/keyword_mute.rb
+++ b/app/models/glitch/keyword_mute.rb
@@ -67,7 +67,7 @@ class Glitch::KeywordMute < ApplicationRecord
 
     def matches?(str, required_scope)
       ((required_scope & scope) == required_scope) && \
-        str =~ (whole_word ? boundary_regex_for_keyword : /#{keyword}/i)
+        str =~ (whole_word ? boundary_regex_for_keyword : /#{Regexp.escape(keyword)}/i)
     end
   end