]> git.openstreetmap.org Git - rails.git/commitdiff
Drop the contents of <script> and <style> tags when we strip them
authorTom Hughes <tom@compton.nu>
Fri, 16 Mar 2012 22:37:15 +0000 (22:37 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 17 Mar 2012 16:37:01 +0000 (16:37 +0000)
config/initializers/sanitize.rb
test/unit/rich_text_test.rb [new file with mode: 0644]

index 7360e2701658a7f02a30c310c1955a61949033fe..0df38f0fa87339702ec4ad6425068fcf3998fa1d 100644 (file)
@@ -1,3 +1,4 @@
 Sanitize::Config::OSM = Sanitize::Config::RELAXED.dup
 
 Sanitize::Config::OSM[:add_attributes] = { 'a' => { 'rel' => 'nofollow' } }
+Sanitize::Config::OSM[:remove_contents] = [ 'script', 'style' ]
diff --git a/test/unit/rich_text_test.rb b/test/unit/rich_text_test.rb
new file mode 100644 (file)
index 0000000..a628eed
--- /dev/null
@@ -0,0 +1,4 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class RichTextTest < ActiveSupport::TestCase
+end