<?xml version="1.0" encoding="UTF-8"?>
<ticket>
  <assigned-user-id type="integer" nil="true"></assigned-user-id>
  <attachments-count type="integer">1</attachments-count>
  <closed type="boolean">true</closed>
  <created-at type="datetime">2008-07-23T15:02:25+01:00</created-at>
  <creator-id type="integer">26939</creator-id>
  <milestone-due-on type="datetime" nil="true"></milestone-due-on>
  <milestone-id type="integer">9903</milestone-id>
  <number type="integer">683</number>
  <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
  <priority type="integer">157</priority>
  <project-id type="integer">8994</project-id>
  <raw-data type="binary" nil="true" encoding="base64"></raw-data>
  <state>committed</state>
  <tag>2.0-stable 2.1 patch sanitize</tag>
  <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
  <updated-at type="datetime">2008-11-14T15:32:43+00:00</updated-at>
  <user-id type="integer">12160</user-id>
  <user-name>Ryan McGeary</user-name>
  <creator-name>sauce</creator-name>
  <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
  <milestone-title>2.x</milestone-title>
  <original-body>Problem with RailsSanitize.white_list_sanitizer.sanitize.

Exemple :
RailsSanitize.white_list_sanitizer.sanitize(&quot;&lt;a href=\&quot;http://www.domain.com?var1=1&amp;var2=2\&quot;&gt;my link&lt;/a&gt;&quot;) is OK and gives &quot;&lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;var2=2\&quot;&gt;my link&lt;/a&gt;&quot;

RailsSanitize.white_list_sanitizer.sanitize(&quot;&lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;var2=2\&quot;&gt;my link&lt;/a&gt;&quot;) is BAD and gives &quot;&lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;amp;var2=2\&quot;&gt;my link&lt;/a&gt;&quot;

As I sanitize each time I save my model, rails sanitize each time &quot;&amp;&quot; so string is growing every time. (&amp;amp;amp;amp;amp;amp;...)</original-body>
  <latest-body>Problem with RailsSanitize.white_list_sanitizer.sanitize.

Exemple :
RailsSanitize.white_list_sanitizer.sanitize(&quot;&lt;a href=\&quot;http://www.domain.com?var1=1&amp;var2=2\&quot;&gt;my link&lt;/a&gt;&quot;) is OK and gives &quot;&lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;var2=2\&quot;&gt;my link&lt;/a&gt;&quot;

RailsSanitize.white_list_sanitizer.sanitize(&quot;&lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;var2=2\&quot;&gt;my link&lt;/a&gt;&quot;) is BAD and gives &quot;&lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;amp;var2=2\&quot;&gt;my link&lt;/a&gt;&quot;

As I sanitize each time I save my model, rails sanitize each time &quot;&amp;&quot; so string is growing every time. (&amp;amp;amp;amp;amp;amp;...)</latest-body>
  <original-body-html>&lt;div&gt;&lt;p&gt;
Problem with RailsSanitize.white_list_sanitizer.sanitize.
&lt;/p&gt;&lt;p&gt;
Exemple :
&lt;/p&gt;&lt;p&gt;
RailsSanitize.white_list_sanitizer.sanitize(&quot;my link&quot;) is OK and gives &quot;my link&quot;
&lt;/p&gt;&lt;p&gt;
RailsSanitize.white_list_sanitizer.sanitize(&quot;my link&quot;) is BAD and gives &quot;my link&quot;
&lt;/p&gt;&lt;p&gt;
As I sanitize each time I save my model, rails sanitize each time &quot;&amp;&quot; so string is growing every time. (&amp;amp;amp;amp;amp;amp;...)
&lt;/p&gt;&lt;/div&gt;</original-body-html>
  <versions type="array">
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Problem with RailsSanitize.white_list_sanitizer.sanitize.

Example :
RailsSanitize.white_list_sanitizer.sanitize(&quot;&amp;lt;a href=\&quot;http://www.domain.com?var1=1&amp;var2=2\&quot;&amp;gt;my link&amp;lt;/a&amp;gt;&quot;) is OK and gives &quot;&amp;lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;amp;var2=2\&quot;&amp;gt;my link&amp;lt;/a&amp;gt;&quot;

RailsSanitize.white_list_sanitizer.sanitize(&quot;&amp;lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;amp;var2=2\&quot;&amp;gt;my link&amp;lt;/a&amp;gt;&quot;) is BAD and gives &quot;&amp;lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;amp;amp;var2=2\&quot;&amp;gt;my link&amp;lt;/a&amp;gt;&quot;

As I sanitize each time I save my model, rails sanitize each time &quot;&amp;&quot; so string is growing every time. (&amp;amp;amp;amp;amp;amp;...)

Sorry for my english I am french !</body>
      <body-html>&lt;div&gt;&lt;p&gt;
Problem with RailsSanitize.white_list_sanitizer.sanitize.
&lt;/p&gt;&lt;p&gt;
Example :
&lt;/p&gt;&lt;p&gt;
RailsSanitize.white_list_sanitizer.sanitize(&quot;&amp;lt;a href=\&quot;http://www.domain.com?var1=1&amp;var2=2\&quot;&amp;gt;my link&amp;lt;/a&amp;gt;&quot;) is OK and gives &quot;&amp;lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;amp;var2=2\&quot;&amp;gt;my link&amp;lt;/a&amp;gt;&quot;
&lt;/p&gt;&lt;p&gt;
RailsSanitize.white_list_sanitizer.sanitize(&quot;&amp;lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;amp;var2=2\&quot;&amp;gt;my link&amp;lt;/a&amp;gt;&quot;) is BAD and gives &quot;&amp;lt;a href=\&quot;http://www.domain.com?var1=1&amp;amp;amp;amp;var2=2\&quot;&amp;gt;my link&amp;lt;/a&amp;gt;&quot;
&lt;/p&gt;&lt;p&gt;
As I sanitize each time I save my model, rails sanitize each time &quot;&amp;&quot; so string is growing every time. (&amp;amp;amp;amp;amp;amp;...)
&lt;/p&gt;&lt;p&gt;
Sorry for my english I am french !
&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-07-23T15:14:21+01:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag nil="true"></tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-07-23T15:14:21+01:00</updated-at>
      <user-id type="integer">26939</user-id>
      <user-name>sauce</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>This [change set](http://github.com/antonmos/rails/commit/9a27a23d077dbdd3e29f8f1b57b6c04e04259151) fixes this issue</body>
      <body-html>&lt;div&gt;&lt;p&gt;This &lt;a href=&quot;http://github.com/antonmos/rails/commit/9a27a23d077dbdd3e29f8f1b57b6c04e04259151&quot;&gt;change set&lt;/a&gt; fixes this issue&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-08-27T19:50:16+01:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- 
:tag: &quot;&quot;
</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-08-27T19:50:16+01:00</updated-at>
      <user-id type="integer">23995</user-id>
      <user-name>antonmos</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>It seems not to be fixed.
CGI.unescape does not know much named entities and character references over U+FFFF.

&lt;img alt=&quot;&amp;#131072; is a &amp;laquo;kanji&amp;raquo;&quot; ...&gt;
gives
&lt;img alt=&quot;&amp;amp;#131072; is a &amp;amp;laquo;kanji&amp;amp;raquo;&quot; ...&gt;

# U+20000 is valid character.
# In category &quot;CJK Unified Ideographs Extension B&quot;

GOOD result is:
&lt;img alt=&quot;&amp;#131072; is a &amp;laquo;kanji&amp;raquo;&quot; ...&gt;
or
&lt;img alt=&quot;&amp;#131072; is a &amp;#171;kanji&amp;#187;&quot; ...&gt;
or
&lt;img alt=&quot;? is a &#171;kanji&#187;&quot; ...&gt;</body>
      <body-html>&lt;div&gt;&lt;p&gt;It seems not to be fixed. CGI.unescape does not know much named
entities and character references over U+FFFF.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;&amp;amp;amp;#131072; is a &amp;amp;amp;laquo;kanji&amp;amp;amp;raquo;&quot;&gt; gives
&lt;img alt=&quot;&amp;amp;amp;amp;#131072; is a &amp;amp;amp;amp;laquo;kanji&amp;amp;amp;amp;raquo;&quot;&gt;&lt;/p&gt;
&lt;h1&gt;U+20000 is valid character.&lt;/h1&gt;
&lt;h1&gt;In category &quot;CJK Unified Ideographs Extension B&quot;&lt;/h1&gt;
&lt;p&gt;GOOD result is: &lt;img alt=&quot;&amp;amp;amp;#131072; is a &amp;amp;amp;laquo;kanji&amp;amp;amp;raquo;&quot;&gt; or &lt;img alt=&quot;&amp;amp;amp;#131072; is a &amp;amp;amp;#171;kanji&amp;amp;amp;#187;&quot;&gt; or &lt;img alt=&quot;? is a &amp;amp;laquo;kanji&amp;amp;raquo;&quot;&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-02T06:11:44+01:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize-2</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-09-02T06:11:44+01:00</updated-at>
      <user-id type="integer">30696</user-id>
      <user-name>Tietew</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>Oops, tags are stripped...

It seems not to be fixed.
CGI.unescape does not know much named entities and character references over U+FFFF.

@@@ html
&lt;img alt=&quot;&amp;#131072; is a &amp;laquo;kanji&amp;raquo;&quot; ...&gt;
gives
&lt;img alt=&quot;&amp;amp;#131072; is a &amp;amp;laquo;kanji&amp;amp;raquo;&quot; ...&gt;
@@@

 # U+20000 is valid character.
 # In category &quot;CJK Unified Ideographs Extension B&quot;

@@@ html
GOOD result is:
&lt;img alt=&quot;&amp;#131072; is a &amp;laquo;kanji&amp;raquo;&quot; ...&gt;
or
&lt;img alt=&quot;&amp;#131072; is a &amp;#171;kanji&amp;#187;&quot; ...&gt;
or
&lt;img alt=&quot;? is a &#171;kanji&#187;&quot; ...&gt;
@@@</body>
      <body-html>&lt;div&gt;&lt;p&gt;Oops, tags are stripped...&lt;/p&gt;
&lt;p&gt;It seems not to be fixed. CGI.unescape does not know much named
entities and character references over U+FFFF.&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
&amp;lt;img alt=&amp;quot;&amp;amp;#131072; is a &amp;amp;laquo;kanji&amp;amp;raquo;&amp;quot; ...&amp;gt;
gives
&amp;lt;img alt=&amp;quot;&amp;amp;amp;#131072; is a &amp;amp;amp;laquo;kanji&amp;amp;amp;raquo;&amp;quot; ...&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;# U+20000 is valid character. # In category &quot;CJK Unified
Ideographs Extension B&quot;&lt;/p&gt;


&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;
GOOD result is:
&amp;lt;img alt=&amp;quot;&amp;amp;#131072; is a &amp;amp;laquo;kanji&amp;amp;raquo;&amp;quot; ...&amp;gt;
or
&amp;lt;img alt=&amp;quot;&amp;amp;#131072; is a &amp;amp;#171;kanji&amp;amp;#187;&amp;quot; ...&amp;gt;
or
&amp;lt;img alt=&amp;quot;? is a &#171;kanji&#187;&amp;quot; ...&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-09-02T06:15:40+01:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize-3</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-09-02T06:15:40+01:00</updated-at>
      <user-id type="integer">30696</user-id>
      <user-name>Tietew</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">0</attachments-count>
      <body>+1 on antonmos's changes.  Here's a formatted patch that incorporates the changes to comply with the Rails contribution guidelines.</body>
      <body-html>&lt;div&gt;&lt;p&gt;+1 on antonmos's changes. Here's a formatted patch that
incorporates the changes to comply with the Rails contribution
guidelines.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-10-17T03:41:43+01:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-10-17T03:41:48+01:00</updated-at>
      <user-id type="integer">12160</user-id>
      <user-name>Ryan McGeary</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>+1. This bug has burned me in my app.  

Patch works, tests passed.</body>
      <body-html>&lt;div&gt;&lt;ol&gt;
&lt;li&gt;This bug has burned me in my app.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Patch works, tests passed.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-10-17T03:55:42+01:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-10-17T03:55:46+01:00</updated-at>
      <user-id type="integer">23189</user-id>
      <user-name>Christopher Murphy</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>That should be +1.</body>
      <body-html>&lt;div&gt;&lt;p&gt;That should be +1.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-10-17T03:56:11+01:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-10-17T03:56:12+01:00</updated-at>
      <user-id type="integer">23189</user-id>
      <user-name>Christopher Murphy</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>+1  This bug has ruined my life.</body>
      <body-html>&lt;div&gt;&lt;p&gt;+1 This bug has ruined my life.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-10-23T01:47:47+01:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-10-23T01:47:50+01:00</updated-at>
      <user-id type="integer">22386</user-id>
      <user-name>Coderifous</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>+1

Patch works great for me. The problem Tietew mentions is a general problem with sanitize and not caused by the proposed patch.

Any chance to get this into 2.2?</body>
      <body-html>&lt;div&gt;&lt;p&gt;+1&lt;/p&gt;
&lt;p&gt;Patch works great for me. The problem Tietew mentions is a
general problem with sanitize and not caused by the proposed
patch.&lt;/p&gt;
&lt;p&gt;Any chance to get this into 2.2?&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">false</closed>
      <created-at type="datetime">2008-11-06T11:17:23+00:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>new</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-11-06T11:17:26+00:00</updated-at>
      <user-id type="integer">9088</user-id>
      <user-name>theflow</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>(from [a358d87e16fa876de29286b69474ab6aaee4a80b]) Fixed the sanitize helper to avoid double escaping already properly escaped entities [#683 state:committed]
http://github.com/rails/rails/commit/a358d87e16fa876de29286b69474ab6aaee4a80b</body>
      <body-html>&lt;div&gt;&lt;p&gt;(from [a358d87e16fa876de29286b69474ab6aaee4a80b]) Fixed the
sanitize helper to avoid double escaping already properly escaped
entities [&lt;a href=&quot;/projects/8994/tickets/683&quot; title=&quot;Ticket #683&quot;&gt;#683&lt;/a&gt; state:committed] &lt;a href=&quot;http://github.com/rails/rails/commit/a358d87e16fa876de29286b69474ab6aaee4a80b&quot;&gt;
http://github.com/rails/rails/co...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-11-06T12:09:01+00:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- 
:state: new
</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>committed</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-11-06T12:09:02+00:00</updated-at>
      <user-id type="integer">17393</user-id>
      <user-name>Repository</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>(from [6406a87eedb74a41f19f5ad21ea1b8f97dd45755]) Fixed the sanitize helper to avoid double escaping already properly escaped entities [#683 state:committed]
http://github.com/rails/rails/commit/6406a87eedb74a41f19f5ad21ea1b8f97dd45755</body>
      <body-html>&lt;div&gt;&lt;p&gt;(from [6406a87eedb74a41f19f5ad21ea1b8f97dd45755]) Fixed the
sanitize helper to avoid double escaping already properly escaped
entities [&lt;a href=&quot;/projects/8994/tickets/683&quot; title=&quot;Ticket #683&quot;&gt;#683&lt;/a&gt; state:committed] &lt;a href=&quot;http://github.com/rails/rails/commit/6406a87eedb74a41f19f5ad21ea1b8f97dd45755&quot;&gt;
http://github.com/rails/rails/co...&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-11-06T12:09:01+00:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>committed</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-11-06T12:09:04+00:00</updated-at>
      <user-id type="integer">17393</user-id>
      <user-name>Repository</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>Sorry, I havn't tried it yet, but it sounds like a bad idea. Maybe as an option, disabled by default. 

But what, if the user wants to write &amp;amp; or &amp;auml; as a comment? As far as I understand, Rails will now ignore these entities and it will be displayed as &amp; or &#228;.</body>
      <body-html>&lt;div&gt;&lt;p&gt;Sorry, I havn't tried it yet, but it sounds like a bad idea.
Maybe as an option, disabled by default.&lt;/p&gt;
&lt;p&gt;But what, if the user wants to write &amp;amp; or &amp;auml; as a
comment? As far as I understand, Rails will now ignore these
entities and it will be displayed as &amp;amp; or &amp;auml;.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-11-14T15:15:20+00:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>committed</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-11-14T15:15:25+00:00</updated-at>
      <user-id type="integer">18453</user-id>
      <user-name>iGEL</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>If you want a demonstration of the problem, look above. Of course I wanted to write &amp; a m p ; and &amp; a u m l; without spaces (I try double escaping: &amp;amp;amp; &amp;amp;auml;). What the user enters should be displayed, he shouldn't care about entities and everything...</body>
      <body-html>&lt;div&gt;&lt;p&gt;If you want a demonstration of the problem, look above. Of
course I wanted to write &amp;amp; a m p ; and &amp;amp; a u m l; without
spaces (I try double escaping: &amp;amp;amp; &amp;amp;auml;). What the user
enters should be displayed, he shouldn't care about entities and
everything...&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-11-14T15:20:48+00:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>committed</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-11-14T15:20:53+00:00</updated-at>
      <user-id type="integer">18453</user-id>
      <user-name>iGEL</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
    <version type="Ticket::Version">
      <assigned-user-id type="integer" nil="true"></assigned-user-id>
      <attachments-count type="integer">1</attachments-count>
      <body>iGEL,  I disagree.  The purpose of the sanitize method is to sanitize HTML input.  The ampersand entities are valid HTML.  When displayed, they should display the entities they represent, not the literal codes.  

In other words, you should expect [&amp; a m p ;] to be displayed as an ampersand.  Just like an html tag shouldn't be escaped to it's lt and gt entities, entities themselves should not be escaped either.</body>
      <body-html>&lt;div&gt;&lt;p&gt;iGEL, I disagree. The purpose of the sanitize method is to
sanitize HTML input. The ampersand entities are valid HTML. When
displayed, they should display the entities they represent, not the
literal codes.&lt;/p&gt;
&lt;p&gt;In other words, you should expect [&amp;amp; a m p ;] to be
displayed as an ampersand. Just like an html tag shouldn't be
escaped to it's lt and gt entities, entities themselves should not
be escaped either.&lt;/p&gt;&lt;/div&gt;</body-html>
      <closed type="boolean">true</closed>
      <created-at type="datetime">2008-11-14T15:32:39+00:00</created-at>
      <creator-id type="integer">26939</creator-id>
      <diffable-attributes type="yaml">--- {}

</diffable-attributes>
      <milestone-id type="integer">9903</milestone-id>
      <number type="integer">683</number>
      <permalink>problem-with-railssanitize-white_list_sanitizer-sanitize</permalink>
      <priority type="integer">0</priority>
      <project-id type="integer">8994</project-id>
      <state>committed</state>
      <tag>2.0-stable 2.1 patch sanitize</tag>
      <title>Problem with RailsSanitize.white_list_sanitizer.sanitize</title>
      <updated-at type="datetime">2008-11-14T15:32:43+00:00</updated-at>
      <user-id type="integer">12160</user-id>
      <user-name>Ryan McGeary</user-name>
      <creator-name>sauce</creator-name>
      <url>http://rails.lighthouseapp.com/projects/8994/tickets/683</url>
      <milestone-title>2.x</milestone-title>
    </version>
  </versions>
  <attachments type="array">
    <attachment type="Attachment">
      <code>2c15f2776769ac52e8781275656d11e56b39ed93</code>
      <content-type>text/plain</content-type>
      <created-at type="datetime">2008-10-17T03:41:43+01:00</created-at>
      <filename>ticket_683.diff</filename>
      <height type="integer" nil="true"></height>
      <id type="integer">54788</id>
      <size type="integer">1946</size>
      <uploader-id type="integer">12160</uploader-id>
      <width type="integer" nil="true"></width>
      <url>http://rails.lighthouseapp.com/attachments/54788/ticket_683.diff</url>
    </attachment>
  </attachments>
</ticket>
