<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,6 +4,8 @@ module Resourceful
       # Sets the default flash message.
       # This message can be overridden by passing in
       # an HTTP parameter of the form &quot;_flash[type]&quot; via POST or GET.
+      # _flash HTTP parameter values will be HTML escaped prior to 
+      # being used.
       #
       # You can use this to easily have multiple forms
       # post to the same create/edit/destroy actions
@@ -17,7 +19,9 @@ module Resourceful
       # TODO: Move this out of here
       #++
       def set_default_flash(type, message)
-        flash[type] ||= (params[:_flash] &amp;&amp; params[:_flash][type]) || message
+        flash[type] ||= (params[:_flash] &amp;&amp; params[:_flash][type]) ? 
+          ERB::Util.h(params[:_flash][type]) : 
+          message
       end
 
       # Sets the default redirect</diff>
      <filename>lib/resourceful/default/responses.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,6 +14,13 @@ describe 'Resourceful::Default::Responses', &quot; with a _flash parameter for :error
     @controller.set_default_flash(:error, &quot;Aw there's no error!&quot;)
     @flash[:error].should == 'Oh no, an error!'
   end
+  
+  it &quot;should set the flash for :error to the parameter's cleansed value when set_default_flash is called on :error&quot; do
+    evil_script = &quot;&lt;script language=\&quot;javascript\&quot;&gt;alert('no good');&lt;/script&gt;&quot;
+    @params[:_flash][:error] = evil_script
+    @controller.set_default_flash(:error, &quot;Aw there's no error!&quot;)
+    @flash[:error].should == ERB::Util.h(evil_script)
+  end
 
   it &quot;should set the flash for :message to the default value when set_default_flash is called on :message&quot; do
     @controller.set_default_flash(:message, &quot;All jim dandy!&quot;)</diff>
      <filename>spec/responses_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a34bdc3b25092da3cbf90f70e6f5ce90f6b4af3a</id>
    </parent>
  </parents>
  <author>
    <name>Nathaniel Bibler</name>
    <email>git@nathanielbibler.com</email>
  </author>
  <url>http://github.com/jcfischer/make_resourceful/commit/26c3e0195e53b1c39bd3f26e7af6ec07c70e487c</url>
  <id>26c3e0195e53b1c39bd3f26e7af6ec07c70e487c</id>
  <committed-date>2008-04-12T11:12:59-07:00</committed-date>
  <authored-date>2008-04-12T11:12:59-07:00</authored-date>
  <message>Added HTML escaping for _flash parameters values.</message>
  <tree>e9c08d70c96b9b057dd29c545c8690a97d71a9ed</tree>
  <committer>
    <name>Nathaniel Bibler</name>
    <email>git@nathanielbibler.com</email>
  </committer>
</commit>
