<?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>Sun, 06 Jul 2008 21:56:00 -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[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>
  </channel>
</rss>
