artmotion / xss_shield

XSS Shield protects your views against cross-site scripting attacks without error-prone manual escaping with h().

This URL has Read+Write access

xss_shield / init.rb
100644 17 lines (15 sloc) 0.24 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
unless ENV['DISABLE_XSS_SHIELD']
  puts "Loading XSS Shield"
  require 'xss_shield'
else
  class ::String
    def mark_as_xss_protected
      self
    end
  end
 
  class ::NilClass
    def mark_as_xss_protected
      self
    end
  end
end