<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Kurinchi Blogger Scribbles ... &#187; html_safe library</title>
	<atom:link href="http://kurinchilamp.kurinchilion.com/tag/html_safe-library/feed" rel="self" type="application/rss+xml" />
	<link>http://kurinchilamp.kurinchilion.com</link>
	<description>On Open Source Technologies</description>
	<lastBuildDate>Mon, 02 Jan 2012 06:14:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>PHP XSS: htmlspecialchars vs. htmlentities</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/05/php-xss-htmlspecialchars-vs-htmlentities.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/05/php-xss-htmlspecialchars-vs-htmlentities.html#comments</comments>
		<pubDate>Sun, 17 May 2009 16:13:55 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Cross site scripting]]></category>
		<category><![CDATA[htmlentities]]></category>
		<category><![CDATA[htmlspecialchars]]></category>
		<category><![CDATA[html_safe library]]></category>
		<category><![CDATA[Pear library]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=333</guid>
		<description><![CDATA[Cross site scripting XSS is a term used to refer attacks or loop holes present in the scripting used by websites favoring hackers to exploit this path towards identity theft or phishing. In PHP, two functions are mainly used to circumvent XSS attacks. i) htmlspecialchars ii) htmlentities i) htmlspecialchars($string, [$quote_option]) takes care of &#038;, &#8220;, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Cross site scripting XSS</strong> is a term used to refer attacks or loop holes present in the scripting used by websites favoring hackers to exploit this path towards identity theft or phishing.</p>
<p>In PHP, two functions are mainly used to circumvent XSS attacks.<br />
i) htmlspecialchars<br />
ii) htmlentities<br />
<span id="more-333"></span><br />
i) <strong>htmlspecialchars</strong>($string, [$quote_option]) takes care of &#038;, &#8220;, &#8216;, <, > characters by converting them into equivalent character codes. If quote option is set to ENT_QUOTES it converts &#8216; &#8211; single quotes to &#039; and if it is set to ENT_NOQUOTES it does not convert &#8221; &#8211; double quotes to &quot;</p>
<p>ii) <strong>htmlentities</strong>() is used to escape all html characters from the text and not just the five characters mentioned above. </p>
<p>Note: If you do not want any html characters in the text, use strip_tags($text) instead.</p>
<p>Also check PEAR&#8217;s <a href="http://pear.php.net/package/HTML_Safe" target="_blank">HTML_Safe library</a> </p>
<p>In wikipedia, you can learn more about <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" target="_blank">XSS </a>and its classification with examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/05/php-xss-htmlspecialchars-vs-htmlentities.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

