<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -158,7 +158,9 @@ module ApplicationHelper
   end
   
   def white_list_with_removal(html)
-    white_list(html) { |node, bad| node.to_s.gsub(/&lt;script.+?&lt;\/script&gt;/mi, '').gsub(/&lt;style.+?&lt;\/style&gt;/mi, '').gsub(/&lt;[^&gt;]+&gt;/, '').gsub(/&lt;/, '&amp;lt;') }
+    html.gsub!(/&lt;script.+?&lt;\/script&gt;/mi, '')
+    html.gsub!(/&lt;style.+?&lt;\/style&gt;/mi, '')
+    white_list(html) { |node, bad| node.to_s.gsub(/&lt;[^&gt;]+&gt;/, '').gsub(/&lt;/, '&amp;lt;') }
   end
   
   def domain_name_from_url(url)</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,9 +2,19 @@ require File.dirname(__FILE__) + '/../../test_helper'
 
 class ApplicationHelperTest &lt; ActionView::TestCase
 
+  include WhiteListHelper
+
   context 'Whitelist' do
     should 'remove style tags and their content' do
-      assert_equal('beforeafter', white_list_with_removal('before&lt;style type=&quot;text/css&quot;&gt;body { font-size: 12pt; }&lt;/style&gt;after'))
+      assert_equal('before after', white_list_with_removal('before &lt;style type=&quot;text/css&quot;&gt;body { font-size: 12pt; }&lt;/style&gt;after'))
+    end
+    
+    should 'remove script tags and their content' do
+      assert_equal('before after', white_list_with_removal('before &lt;script type=&quot;text/javascript&quot;&gt;alert(&quot;hi&quot;)&lt;/script&gt;after'))
+    end
+    
+    should 'remove other illegal tags' do
+      assert_equal('before and after', white_list_with_removal('before &lt;bad&gt;and&lt;/bad&gt; after'))
     end
   end
   </diff>
      <filename>test/unit/helpers/application_helper_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c23daf4200eb51f35fdbcb80de0d6dfebbff6313</id>
    </parent>
  </parents>
  <author>
    <name>Tim Morgan</name>
    <email>tim@timmorgan.org</email>
  </author>
  <url>http://github.com/seven1m/onebody/commit/1d488d7eb88d0a60721f1c4315b490efd328e53e</url>
  <id>1d488d7eb88d0a60721f1c4315b490efd328e53e</id>
  <committed-date>2009-10-24T07:00:14-07:00</committed-date>
  <authored-date>2009-10-24T07:00:14-07:00</authored-date>
  <message>Ensure removal of content within script and style tags.</message>
  <tree>4ee4c1d075453de088ae84241342648b8feb0588</tree>
  <committer>
    <name>Tim Morgan</name>
    <email>tim@timmorgan.org</email>
  </committer>
</commit>
