<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Fri, 24 May 2013 02:29:39 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Reddit.com: What everyone should know about strip_tags()]]></title>
      <guid>http://www.phpdeveloper.org/news/17282</guid>
      <link>http://www.phpdeveloper.org/news/17282</link>
      <description><![CDATA[<p>
In <a href="http://www.reddit.com/r/PHP/comments/nj5t0/what_everyone_should_know_about_strip_tags/">this new post to Reddit</a>, the author shares a bit of their knowledge on what they think everyone should know about <a href="http://php.net/strip_tags">strip_tags</a> and some of the issues that can come with it (including security problems).
</p>
<blockquote>
<a href="http://www.php.net/manual/en/function.strip-tags.php">strip_tags</a> is one of the common go-to functions used for making user input on web pages safe for display. But contrary to what it sounds like it's for, strip_tags is never, ever, ever the right function to use for this and it has a lot of problems.
</blockquote>
<p>
Specific problems mentioned include "eating" of valid text, not preventing typed HTML entities, the whitelist of tags opening holes and character set issues that could have security implications. Other tools are recommended in both the article and the comments like <a href="http://htmlpurifier.org/">HTML Purifier</a>, the option of <a href="https://secure.wikimedia.org/wikipedia/en/wiki/BBCode">BBCode</a> and <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Markdown">Markdown</a>.
</p>]]></description>
      <pubDate>Tue, 20 Dec 2011 10:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Jason Stiles' Blog: How To Protect Your Site From XSS With PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16458</guid>
      <link>http://www.phpdeveloper.org/news/16458</link>
      <description><![CDATA[<p>
In a recent post to his blog <i>Jason Stiles</i> takes a look at some of the things you can do with PHP to help <a href="http://jstiles.com/Blog/How-To-Protect-Your-Site-From-XSS-With-PHP">protect your site from XSS</a> (cross-site scripting attacks) with some basic filtering.
</p>
<blockquote>
Cross-Site Scripting (XSS) is a type of attack where a hacker attempts to inject client-side scripting into a webpage that others are able to view.  The attack could be as simple as an annoying alert window or as sophisticated as stealing a logged in user's credentials (commonly saved in browser cookies). [...] Since these types of user input can immediately be displayed to other user's, the attack could be spread pretty quickly and even without your knowledge. 
</blockquote>
<p>
He provides a basic function to get you started filtering the input from your users - a "xss_protect" method that takes in the data, whether to strip HTML tags or not and an optional set of allowed tags if you do. He also asks for opinions and better methods in his comments:
</p>
<blockquote>
No solution is going to be perfect, but at least now you have a head start!  If you have ways of improving this function, let myself and everyone else know in <a href="http://jstiles.com/Blog/How-To-Protect-Your-Site-From-XSS-With-PHP#comments">the comments</a>. 
</blockquote>]]></description>
      <pubDate>Mon, 13 Jun 2011 09:40:42 -0500</pubDate>
    </item>
  </channel>
</rss>
