<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 require 'net/http'
 require 'uri'
+$:.unshift(File.dirname(__FILE__)+'/../htmlentities/lib/')
+require 'htmlentities'
 
 # post to tumblr.com -- see http://www.tumblr.com/api/
 class BotSender::Tumblr &lt; BotSender
@@ -16,7 +18,7 @@ class BotSender::Tumblr &lt; BotSender
     source = %Q[&lt;a href=&quot;#{args[:url]}&quot;&gt;#{source}&lt;/a&gt;] if args[:url]
     result = Net::HTTP.post_form(URI.parse(@post_url), { 
       :type     =&gt; 'quote', 
-      :quote    =&gt; (args[:quote] || ''), 
+      :quote    =&gt; HTMLEntities.new.encode(args[:quote] || ''), 
       :source   =&gt; source, 
       :email    =&gt; @email, 
       :password =&gt; @password</diff>
      <filename>lib/senders/tumblr.rb</filename>
    </modified>
    <modified>
      <diff>@@ -139,6 +139,13 @@ describe BotSender::Tumblr, &quot;when posting a quote&quot; do
     @sender.do_quote(:quote =&gt; 'sibboleth, yo!', :source =&gt; 'ymendel')
   end
   
+  it 'should escape HTML entities in the quote body' do
+    Net::HTTP.expects(:post_form).with do |url, args|
+      args[:quote] == 'xmlrpc = &amp;lt;win&amp;gt;&amp;lt;/win&amp;gt;'
+    end
+    @sender.do_quote(:quote =&gt; 'xmlrpc = &lt;win&gt;&lt;/win&gt;', :source =&gt; 'vinbarnes')
+  end
+  
   it &quot;should set the quote source to the provided source&quot; do
     Net::HTTP.expects(:post_form).with do |url, args|
       args[:source] == 'ymendel'</diff>
      <filename>spec/bot_sender_tumblr_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3e37750ffacb3cd760dd328601acc6f114e2343e</id>
    </parent>
  </parents>
  <author>
    <name>Yossef Mendelssohn</name>
    <email>ymendel@pobox.com</email>
  </author>
  <url>http://github.com/flogic/nihilist_bot/commit/f97a3d87ca4584799c07a7cf0f5cb0657f7b7182</url>
  <id>f97a3d87ca4584799c07a7cf0f5cb0657f7b7182</id>
  <committed-date>2008-07-30T17:57:23-07:00</committed-date>
  <authored-date>2008-07-30T17:57:23-07:00</authored-date>
  <message>Encoding HTML entities in quotes when sending to Tumblr.</message>
  <tree>f3c0ffa8101218faab462636fa5cfadf6a5d845d</tree>
  <committer>
    <name>Yossef Mendelssohn</name>
    <email>ymendel@pobox.com</email>
  </committer>
</commit>
