<?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>Sat, 06 Sep 2008 18:55:38 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Mark Kimsal's Blog: Addslashes(): don't call it a comeback]]></title>
      <guid>http://www.phpdeveloper.org/news/10401</guid>
      <link>http://www.phpdeveloper.org/news/10401</link>
      <description><![CDATA[<p>
As <i>Michael Kimsal</i> <a href="http://michaelkimsal.com/blog/php-addslashes-alternatives-comparison/">points out</a>, there's a <a href="http://cognifty.com/index.php/blog.entry/id=6/addslashes_dont_call_it_a_comeback.html">new posting</a> on his brother <i>Mark</i>'s blog talking about alternatives to addslashes() in your applications.
</p>
<blockquote>
I've seen a lot of people talking about mysql_real_escape_string() vs addslashes() vs addcslashes(). There seems to be a lot of real confusion about what these functions do (even with the php.net manual around), especially when it comes to character sets. [...] So, I've decided to lay it all out in a few charts so there is no confusion about what each function does and how each can help protect against SQL injection attacks.
</blockquote>
<p>
He <a href="http://cognifty.com/index.php/blog.entry/id=6/addslashes_dont_call_it_a_comeback.html">ran some tests</a> based on what the function does to see if it helps with certain things like "escapes with single quotes instead of backslash" and "prevents multi-byte attacks". He compares the speed and testability of the functions as well as provides a multi-byte breakdown oh how the mysql_real_escape_string function works with different character sets.
</p>]]></description>
      <pubDate>Thu, 12 Jun 2008 13:36:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christopher Jones' Blog: PHP 5.3 "NOWDOCS" make SQL escaping easier]]></title>
      <guid>http://www.phpdeveloper.org/news/9633</guid>
      <link>http://www.phpdeveloper.org/news/9633</link>
      <description><![CDATA[<p>
<i>Christopher Jones</i> has <a href="http://blogs.oracle.com/opal/2008/02/13#a269">posted about</a> an update to the development for PHP 5.3 that makes escaping SQL even easier in scripts - NOWDOCS.
</p>
<blockquote>
Escaping quotes or other meta characters in SQL can be painful unless you get lucky with your quoting style. [...] Even with PHP's "Heredoc" syntax something will need escaping, but with PHP 5.3's new "Nowdoc" syntax no escaping is needed.
</blockquote>
<p>
The only difference between HEREDOC and NOWDOC is that the initial keyword (like the first END in this statement: <<<'END' text here END;) that can make worrying about complex quoting rules a thing of the past.
</p>]]></description>
      <pubDate>Thu, 14 Feb 2008 11:18:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: A View Stream with Zend_View]]></title>
      <guid>http://www.phpdeveloper.org/news/9581</guid>
      <link>http://www.phpdeveloper.org/news/9581</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has <a href="http://akrabat.com/2008/02/05/a-view-stream-with-zend_view/">posted about</a> a small modification that he made to his Zend Framework setup that allows for a little safer echoing of information out to the View later of an application.
</p>
<blockquote>
One of my biggest issues with using PHP as the templating engine in View scripts is that the easiest way to echo a variable is the least secure. [...] So, I decided to leverage <a href="http://mikenaberezny.com/2006/02/19/symphony-templates-ruby-erb/">a post by Mike Naberezny</a> from a while ago about streams. The idea is all his; I just modified it to work with Zend Framework's Zend_View the way I wanted it to.
</blockquote>
<p>
His method uses a slightly different output format - instead of using a normal echo statement to push out the escaped output, it uses a special syntax using the "@" sign as a shortcut to the call to escape(). He includes the code you'll need to make it work in your ZF install and explain it a bit (including where the real key lies - in stream_popen). 
</p>]]></description>
      <pubDate>Thu, 07 Feb 2008 07:58:17 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Girouard's Blog: FIEO with PHP 5 Interceptors]]></title>
      <guid>http://www.phpdeveloper.org/news/9001</guid>
      <link>http://www.phpdeveloper.org/news/9001</link>
      <description><![CDATA[<p>
<i>Michael Girouard</i> has a <a href="http://www.lovemikeg.com/blog/2007/10/30/feio-with-php-5-interceptors/">post on his blog</a> about something that's becoming more and more wide-spread in the PHP community (thankfully) - filtering input from users and escaping the output to ensure the safety of your application.
</p>
<blockquote>
The idea itself is simple. When data comes into your application, it must be filtered prior to it actually being used for any reason. This means all data. Form values, URL values, and yes, even the values in the forever useful $_SERVER superglobal. [...] Before leaving your application, data should be properly escaped with the specific output medium in mind. 
</blockquote>
<p>
<a href="http://www.lovemikeg.com/blog/2007/10/23/the-abstract-collection/">Previously</a> he showed how, using an interceptor method in PHP5, you could build "collections of data". He uses the same sort of method here, appling custom filters to the data based on the output call. Code is included for both the filtering interface and two example filters - one for SQL and the other for HTML.
</p>
<p>
You can also <a href="http://www.lovemikeg.com/downloads/DataFilter.php.txt">grab the code</a> if you just want to play with that.
</p>]]></description>
      <pubDate>Thu, 08 Nov 2007 08:41:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[International PHP Magazine: Poll Question: What is the Top Mistake That PHP Coders Commit?]]></title>
      <guid>http://www.phpdeveloper.org/news/7238</guid>
      <link>http://www.phpdeveloper.org/news/7238</link>
      <description><![CDATA[<p>
The International PHP Magazine has <a href="http://www.php-mag.net/magphpde/magphpde_news/psecom,id,26857,nodeid,5.html">posted results</a> from their latest PHP community poll as voted on by visitors to their site. The question for this poll asked developers what they thought, of the choices on the list, was the most common mistake that PHP developers make.
</p>
<p>
Coming in at number one by an overwhelming lead was "Not escaping entities and SQL input" (a definite problem indeed) with the next highest option, "Not using a Framework" a full twenty percent lower. The next two options were closer (descending) - "Using old PHP versions" and "No or little use of Object Orientation".
</p>
<p>
There's a <a href="http://www.php-mag.net/magphpde/magphpde_news/psecom,id,26858,nodeid,5.html">new poll</a> this week for your consideration - this time asking which stage, of the five options, should come first in the development cycle of a typical content management system. Head on over and cast your vote today!
</p>]]></description>
      <pubDate>Wed, 07 Feb 2007 10:43:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Reign's SourceRally Blog: The PHP coder's top 10 mistakes and problems]]></title>
      <guid>http://www.phpdeveloper.org/news/7072</guid>
      <link>http://www.phpdeveloper.org/news/7072</link>
      <description><![CDATA[<p>
On his SourceRally blog, <i>reign</i> as <a href="http://www.sourcerally.net/regin/8-The-PHP-coder%27s-top-10-mistakes-and-problems">a new post</a> listing out the "Top 10 Mistakes & Problems" that PHP developers make.
</p>
<blockquote>
Seeing the number of problems and mistakes PHP coders encounter repeatedly I set out to make this list of the 10 most common problems and mistakes done by PHP coders.
</blockquote>
<p>
Included on the list are some of the usual suspects:
<ul>
<li>Not escaping entities
<li>Not Escaping SQL input
<li>Requiring and including files using untrusted data
<li>Syntax errors
</ul>
But there's also a few that are just good recommendations and aren't really problems (like using a framework or OOP in an application). Check out the <a href="http://www.sourcerally.net/regin/8-The-PHP-coder%27s-top-10-mistakes-and-problems">full list here</a>.
</p>]]></description>
      <pubDate>Wed, 10 Jan 2007 11:36:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Integrating Smarty with the Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/5109</guid>
      <link>http://www.phpdeveloper.org/news/5109</link>
      <description><![CDATA[For anyone that's using or wanted to use Smarty in the future and has been looking into the Zend Framework, you might have hesitated until you know how to tie them both together. Well, wait no more! <a href="http://devzone.zend.com/node/view/id/120">This new post</a> from the Zend Developer Zone shows you exactly how.
<p>
<quote>
<i>
Inspired by this article I started to play around a bit to integrate the Smarty template engine into the Zend Framework. My ambition was to minimize the required code in the controller actions but stay close to the given Zend_View API. I also wanted to integrate the Smarty caching feature. Here is the code I came up with.
</i>
</quote>
<p>
He <a href="http://devzone.zend.com/node/view/id/120">sets up</a> a directory under his Zend library include path for the templates to live in and starts writing code. The first step is a class that's based off the Zend_View_Abstract class to set the initial Smarty variables. He follows this up with serveral methods - __run, assign, and escape before displaying the results with output(). 
<p>
Finally, he gives an example of how to use the class he's created to spit out a Smarty template with all of the data nicely in place.
<p>
More information on the Zend Framework can be found at <a href="http://framework.zend.com">framework.zend.com</a>, and information on Smarty at <a href="http://smarty.php.net/">smarty.php.net</a>]]></description>
      <pubDate>Wed, 05 Apr 2006 07:22:43 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPit.net: PHP Security - Basic PHP Security]]></title>
      <guid>http://www.phpdeveloper.org/news/4671</guid>
      <link>http://www.phpdeveloper.org/news/4671</link>
      <description><![CDATA[On PHPit.net today, there's <a href="http://www.phpit.net/article/php-security-basic/">a basic look</a> at some of the PHP security concerns developers should pay attention to when working up their scripts.
<p>
<quote>
<i>
Security in PHP has become one of the most popular topics in the PHP community lately, especially with an increased number of exploits and security problems. In this day and age, you must make sure your PHP scripts are airtight, and that they don't have any security problems.
<p>
To make sure the security in your PHP scripts are okay, you have to start with the basics: filter input, and escape output. If you haven't got that working properly, your scripts will always be open to security problems. Read this article to learn how to properly do these two things.
</i>
</quote>
<p>
While it's a very basic <a href="http://www.phpit.net/article/php-security-basic/">step to security</a> in your scripts, these two considerations for the data entering/leaving could help protect you from some of the more heinous security issues...]]></description>
      <pubDate>Mon, 16 Jan 2006 07:11:27 -0600</pubDate>
    </item>
  </channel>
</rss>
