Permalink
Browse files

Escape blacklisted terms before you run them as a regexp

  • Loading branch information...
Aditya Chadha
Aditya Chadha committed Apr 28, 2009
1 parent b37fa2c commit f336f374ba4797b5a34b7b67315c7c5a4fbf1683
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/tasks/sickcity.rake
View
@@ -25,7 +25,7 @@ namespace "sickcity" do
if !destroy
Badword.all.each do |badword|
- if text =~ /#{badword.term}/
+ if text =~ /#{Regexp.escape(badword.term)}/
destroy = true
end
break if destroy == true

0 comments on commit f336f37

Please sign in to comment.