<?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, 25 May 2013 18:00:22 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Paul Reinheimer's Blog: The Danger of Hooks]]></title>
      <guid>http://www.phpdeveloper.org/news/17383</guid>
      <link>http://www.phpdeveloper.org/news/17383</link>
      <description><![CDATA[<p>
<i>Paul Reinheimer</i> has a recent post to his blog talking about <a href="http://blog.preinheimer.com/index.php?/archives/370-The-Danger-of-Hooks.html">the danger of "hooks"</a> in your development - the functionality several frameworks and other tools come with to allow you to add functionality to the core without having to change the main source.
</p>
<blockquote>
I ran into hooks rather simultaneously with two very different frameworks: Code Igniter and Lithium. In both cases I was using a rather nifty hook to handle ensuring that users were properly authenticated and authorized before accessing a page. [...] One day, while messing around, I accidentally turned off the hook configuration within Code Igniter (actually I clobbered a file, and restored the wrong one). Then, things came crashing down in a horrible cacophony of... actually they didn't. Everything kept working: that was the problem.
</blockquote>
<p>
He shows two solutions he came up with to be sure that his hooks were executed - one for Lithium and the other for CodeIgniter. The Lithium one uses a "_remap" method and the CodeIgniter example uses the magic "__invoke" method to check for an "AUTH_CHECKED" constant that's only defined as a part of his hooks.
</p>
<blockquote>
I'm no longer entirely dependent on one configuration option or file for my security to function. Should it fail, I've got a secondary check in place; this example of defence in depth allows me to be comfortable with the hooks security system once more.
</blockquote>]]></description>
      <pubDate>Thu, 12 Jan 2012 09:12:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Giorgio Sironi's Blog: The dangers of Late Static Bindings]]></title>
      <guid>http://www.phpdeveloper.org/news/14346</guid>
      <link>http://www.phpdeveloper.org/news/14346</link>
      <description><![CDATA[<p>
<i>Giorgio Sironi</i> has a new post that <a href="http://giorgiosironi.blogspot.com/2010/04/dangers-of-late-static-bindings.html">warns you of the dangers</a> that could come from the use of a technology just recently introduced to PHP - late static binding.
</p>
<blockquote>
There's a lot of (justified) excitement about <a href="http://php.net/">PHP</a> 5.3 new features, such as the support of namespaces and anonymous functions. Though, some glittering capabilities of the language are definitely not gold: the goto statement is probably the most debated example, but also the long-awaited Late Static Bindings support is an hammer which may hurt your fingers...
</blockquote>
<p>
He talks about how two of the characteristics of late static binding - the fact that it involves something being static and that there's a sort of hierarchy involved. He gives a code example of how it could be used and notes that static functions should be used sparingly since they are a more procedural way of doing things.
</p>
<p>
The post also includes a good example - an abstract Factory method - and a bad example - Active Record that doesn't evolve towards a Repository pattern being used.
</p>]]></description>
      <pubDate>Wed, 14 Apr 2010 07:06:41 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP Discovery Blog: Dangers of Remote Execution]]></title>
      <guid>http://www.phpdeveloper.org/news/9092</guid>
      <link>http://www.phpdeveloper.org/news/9092</link>
      <description><![CDATA[<p>
On the PHP Discovery blog, there's a <a href="http://phpdiscovery.com/dangers-of-remote-execution/">new post</a> reminding PHP developers of some of the more dangerous ways that remote execution could effect your site and some of the common entry points it can have.
</p>
<blockquote>
PHP has numerous ways to execute raw PHP code unless you the programmer stops it.  Best way in preventing these methods is making sure you check the input of what your users are inputting, and making sure you escape all malicious actions that a hacker,cracker, kiddy scripter might want to do to your website. 
</blockquote>
<p>
He summarizes four of the things from the <a href="http://apress.com/book/view/1590595084">Pro PHP Security</a> book from Apress (by <i>Chris Snyder</i> and <i>Michael Southwell</i>) that can leave holes in you application for would-be explots - preg_replace, shell_exec/exec, eval (which we all know is only one letter from "evil" anyway) and require/include.
</p>]]></description>
      <pubDate>Wed, 21 Nov 2007 13:48:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ivo Jansch's Blog: The danger of Fluent interfaces]]></title>
      <guid>http://www.phpdeveloper.org/news/4583</guid>
      <link>http://www.phpdeveloper.org/news/4583</link>
      <description><![CDATA[On <i>Ivo Jansch</i>'s blog today, he takes the other side of things on the issue of <a href="http://www.achievo.org/blog/archives/25-The-danger-of-Fluent-interfaces.html">fluent interfaces.
<p>
<quote>
<i>
After Martin, Mike and Paul have demonstrated the usefulness of Fluent Interfaces, I'd like to take a look at the downside.
<p>
Ironically, Martin's original example already demonstrates the problem. (In the example) newOrder could be implemented in two ways: Create an order and return that new order, and Add an order to this customer and return the customer.
<p>
This can lead to confusion; the 'with()' method employs method b. If you think that newOrder returns an Order, and hence 'with()' is a method of the Order class, look at 'skippable'. Martin states that order lines are skippable. So what's in front of skippable() is an OrderItem. That means that with() must have returned an OrderItem. If that is true, then with() is a method of OrderLine too!
</i>
</quote>
<p>
Confused yet? Well, be sure to <a href="http://www.achievo.org/blog/archives/25-The-danger-of-Fluent-interfaces.html">check out his examples</a> - they help to clear up at least the items mentioned above. His point is that, while the fluent interface does make it more readable, it can also make it more confusing - taking things down to such a simple level can sometimes eliminate some needed complexity to make things work properly (or as the user percieves "properly" to be)...]]></description>
      <pubDate>Fri, 30 Dec 2005 07:07:45 -0600</pubDate>
    </item>
  </channel>
</rss>
