<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: htmlentities is badly designed</title>
	<atom:link href="http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/</link>
	<description>Javascript blog with messed up syntax inside</description>
	<lastBuildDate>Thu, 26 Jan 2012 01:38:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Mtutnid</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-1844</link>
		<dc:creator>Mtutnid</dc:creator>
		<pubDate>Thu, 14 Oct 2010 14:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-1844</guid>
		<description>By specifying UYF-8 you are exposing your website to an overflow vulnerability. :D:D funny. You have to upgrade to the newest version of PHP to prevent this.</description>
		<content:encoded><![CDATA[<p>By specifying UYF-8 you are exposing your website to an overflow vulnerability. <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> :D funny. You have to upgrade to the newest version of PHP to prevent this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Glover</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-1481</link>
		<dc:creator>Jeremy Glover</dc:creator>
		<pubDate>Thu, 19 Mar 2009 15:26:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-1481</guid>
		<description>Great catch.  Just did a find and replace in my code on 72 instances.</description>
		<content:encoded><![CDATA[<p>Great catch.  Just did a find and replace in my code on 72 instances.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: open source</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-953</link>
		<dc:creator>open source</dc:creator>
		<pubDate>Thu, 29 Nov 2007 20:49:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-953</guid>
		<description>Manual... ;)</description>
		<content:encoded><![CDATA[<p>Manual&#8230; <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Strojny</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-936</link>
		<dc:creator>Lars Strojny</dc:creator>
		<pubDate>Tue, 27 Nov 2007 14:41:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-936</guid>
		<description>As Michelangelo van Dam and Ed Finkler pointed out, you should also specify the charset. But specifying it does not help, as you first need to enforce the input charset to get rid of UTF-7 attacks and stuff. Something like this would work:
$input = iconv($_GET[&#039;input&#039;], &#039;UTF-8&#039;, &#039;UTF-8&#039;);
$input = htmlentities($input, ENT_QUOTES, $input);</description>
		<content:encoded><![CDATA[<p>As Michelangelo van Dam and Ed Finkler pointed out, you should also specify the charset. But specifying it does not help, as you first need to enforce the input charset to get rid of UTF-7 attacks and stuff. Something like this would work:<br />
$input = iconv($_GET['input'], &#8216;UTF-8&#8242;, &#8216;UTF-8&#8242;);<br />
$input = htmlentities($input, ENT_QUOTES, $input);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-935</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Tue, 27 Nov 2007 12:12:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-935</guid>
		<description>Sure whitelist filters and the like would be a better approach. Still my main point was the misunderstanding of htmlenitites and htmlspecialchars or any other function which requires the second parameter to escape quotes.

Many developers think that this is being done and it clearly isn&#039;t.</description>
		<content:encoded><![CDATA[<p>Sure whitelist filters and the like would be a better approach. Still my main point was the misunderstanding of htmlenitites and htmlspecialchars or any other function which requires the second parameter to escape quotes.</p>
<p>Many developers think that this is being done and it clearly isn&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Manico</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-934</link>
		<dc:creator>Jim Manico</dc:creator>
		<pubDate>Tue, 27 Nov 2007 11:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-934</guid>
		<description>I don&#039;t think we want to be using any of these functions in a day-2-day fashion. We should be rolling these functions into platform level easier-to-user functions that all programmers on our teams must use. Drupal security is poor at best overall, but I like their direction of their php input validation functions: http://api.drupal.org/?q=api/group/validation/5 and the like.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think we want to be using any of these functions in a day-2-day fashion. We should be rolling these functions into platform level easier-to-user functions that all programmers on our teams must use. Drupal security is poor at best overall, but I like their direction of their php input validation functions: <a href="http://api.drupal.org/?q=api/group/validation/5" rel="nofollow">http://api.drupal.org/?q=api/group/validation/5</a> and the like.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phpnewuser</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-933</link>
		<dc:creator>phpnewuser</dc:creator>
		<pubDate>Tue, 27 Nov 2007 03:38:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-933</guid>
		<description>if I use htmlentities just to decode specialchars like Ã¡Ã©Ã­Ã³ÃºÃ±Ã‘, i wonder if its wrong.

What would you use instead ?</description>
		<content:encoded><![CDATA[<p>if I use htmlentities just to decode specialchars like Ã¡Ã©Ã­Ã³ÃºÃ±Ã‘, i wonder if its wrong.</p>
<p>What would you use instead ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Finkler</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-932</link>
		<dc:creator>Ed Finkler</dc:creator>
		<pubDate>Tue, 27 Nov 2007 00:01:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-932</guid>
		<description>And that was already in the first comment. Sorry about that... long day. 8)</description>
		<content:encoded><![CDATA[<p>And that was already in the first comment. Sorry about that&#8230; long day. <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Finkler</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-931</link>
		<dc:creator>Ed Finkler</dc:creator>
		<pubDate>Mon, 26 Nov 2007 23:56:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-931</guid>
		<description>Smarter people than me have suggested that one should also pass the $charset param to htmlentities or htmlspecialchars. 

http://shiflett.org/blog/2007/may/character-encoding-and-xss

I agree with the supposition that the PHP escaping functions require too much work to be &quot;safe,&quot; though.</description>
		<content:encoded><![CDATA[<p>Smarter people than me have suggested that one should also pass the $charset param to htmlentities or htmlspecialchars. </p>
<p><a href="http://shiflett.org/blog/2007/may/character-encoding-and-xss" rel="nofollow">http://shiflett.org/blog/2007/may/character-encoding-and-xss</a></p>
<p>I agree with the supposition that the PHP escaping functions require too much work to be &#8220;safe,&#8221; though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-930</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Mon, 26 Nov 2007 22:33:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-930</guid>
		<description>Good information to know Felix thanks</description>
		<content:encoded><![CDATA[<p>Good information to know Felix thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

