<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -16,9 +16,12 @@ module InPlaceEditing
   module ClassMethods
     def in_place_edit_for(object, attribute, options = {})
       define_method(&quot;set_#{object}_#{attribute}&quot;) do
+        unless [:post, :put].include?(request.method) then
+          return render(:text =&gt; 'Method not allowed', :status =&gt; 405)
+        end
         @item = object.to_s.camelize.constantize.find(params[:id])
         @item.update_attribute(attribute, params[:value])
-        render :text =&gt; @item.send(attribute).to_s
+        render :text =&gt; CGI::escapeHTML(@item.send(attribute).to_s)
       end
     end
   end</diff>
      <filename>lib/in_place_editing.rb</filename>
    </modified>
    <modified>
      <diff>@@ -69,10 +69,12 @@ module InPlaceMacrosHelper
   
   # Renders the value of the specified object and method with in-place editing capabilities.
   def in_place_editor_field(object, method, tag_options = {}, in_place_editor_options = {})
-    tag = ::ActionView::Helpers::InstanceTag.new(object, method, self)
-    tag_options = {:tag =&gt; &quot;span&quot;, :id =&gt; &quot;#{object}_#{method}_#{tag.object.id}_in_place_editor&quot;, :class =&gt; &quot;in_place_editor_field&quot;}.merge!(tag_options)
-    in_place_editor_options[:url] = in_place_editor_options[:url] || url_for({ :action =&gt; &quot;set_#{object}_#{method}&quot;, :id =&gt; tag.object.id })
-    tag.to_content_tag(tag_options.delete(:tag), tag_options) +
-    in_place_editor(tag_options[:id], in_place_editor_options)
+    instance_tag = ::ActionView::Helpers::InstanceTag.new(object, method, self)
+    tag_options = {:tag =&gt; &quot;span&quot;,
+                   :id =&gt; &quot;#{object}_#{method}_#{instance_tag.object.id}_in_place_editor&quot;,
+                   :class =&gt; &quot;in_place_editor_field&quot;}.merge!(tag_options)
+    in_place_editor_options[:url] = in_place_editor_options[:url] || url_for({ :action =&gt; &quot;set_#{object}_#{method}&quot;, :id =&gt; instance_tag.object.id })
+    tag = content_tag(tag_options.delete(:tag), h(instance_tag.value(instance_tag.object)),tag_options)
+    return tag + in_place_editor(tag_options[:id], in_place_editor_options)
   end
 end</diff>
      <filename>lib/in_place_macros_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>afb68bba782f8ae0ea56494f200f1fe9c811e164</id>
    </parent>
  </parents>
  <author>
    <name>Pawel Stradomski</name>
    <email>pstradomski@gmail.com</email>
  </author>
  <url>http://github.com/rails/in_place_editing/commit/8c5487e4620fe02074ff48ea27fecac2df6e7f52</url>
  <id>8c5487e4620fe02074ff48ea27fecac2df6e7f52</id>
  <committed-date>2009-02-27T18:42:39-08:00</committed-date>
  <authored-date>2009-02-23T13:14:06-08:00</authored-date>
  <message>Security fixes for XSS and CSRF issues.

Signed-off-by: Michael Koziarski &lt;michael@koziarski.com&gt;</message>
  <tree>5f99e8664a323a636fed2be0b00f9a8322da0bbc</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
