<?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"
	>
<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>A tool for designers dealing with programmers dealing with designers...</description>
	<pubDate>Tue, 14 Oct 2008 01:38:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<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['input'], 'UTF-8', 'UTF-8');
$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'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'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 "safe," 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>
	<item>
		<title>By: Felix Zaslavskiy</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-929</link>
		<dc:creator>Felix Zaslavskiy</dc:creator>
		<pubDate>Mon, 26 Nov 2007 22:25:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-929</guid>
		<description>I looked into the htmlentities implementation a while back and its implemented pretty inefficiently so you got to watch out you will be calling it thousands of times in a loop or encoding the same input multiple times.  htmlspecialchars is probably much faster.</description>
		<content:encoded><![CDATA[<p>I looked into the htmlentities implementation a while back and its implemented pretty inefficiently so you got to watch out you will be calling it thousands of times in a loop or encoding the same input multiple times.  htmlspecialchars is probably much faster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-925</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Mon, 26 Nov 2007 13:33:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/11/26/htmlentities-is-badly-designed/#comment-925</guid>
		<description>Yep that's the point I was trying to make in my last comment ;)</description>
		<content:encoded><![CDATA[<p>Yep that&#8217;s the point I was trying to make in my last comment <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
