<?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>Thu, 23 May 2013 16:12:58 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Paul Jones' Blog: When Possible, Use File *Resources* Instead Of File *Names*]]></title>
      <guid>http://www.phpdeveloper.org/news/18173</guid>
      <link>http://www.phpdeveloper.org/news/18173</link>
      <description><![CDATA[<p>
In <a href="http://paul-m-jones.com/archives/2487">this new post</a> to his blog <i>Paul Jones</i> makes a suggestion when you're working with files or external connections in your PHP applications - pass the resource, not the file/path name for more flexibility.
</p>
<blockquote>
In testing the <a href="https://github.com/auraphp/Aura.Http">Aura.Http</a> package, I have realized that it's much more flexible, testing wise, to pass around file resources (a.k.a. handles, pointers, or streams) than it is to pass around file names. When you do that, you can use a php://memory stream instead of attempting to touch the file system.
</blockquote>
<p>
He shows how using this method can make it easier to test with a simple bit of refactoring by passing in the "php://memory" stream rather than the actual file reference. The comment (from <i>Chris Hartjes</i>) also suggests an alternative tool for working with tests that need the file system, <a href="https://github.com/mikey179/vfsStream">vfsStream</a>.
</p>]]></description>
      <pubDate>Wed, 04 Jul 2012 14:10:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: File Path Injection in PHP <= 5.3.6 File Update (CVE 2011-2202)]]></title>
      <guid>http://www.phpdeveloper.org/news/16495</guid>
      <link>http://www.phpdeveloper.org/news/16495</link>
      <description><![CDATA[<p>
On DZone.com's PHP on Windows section today <i>Krzysztof Kotowicz</i> has a new post talking about <a href="http://css.dzone.com/articles/file-path-injection-php-536">a file path injection exploit</a> in PHP versions lower than 5.3.6.
</p>
<blockquote>
Since the thing <a href="http://www.devquotes.com/2011/06/15/php-cve-2011-2202/">went public</a> before new PHP version has been released, I present full details of the <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-2202">latest PHP vulnerability</a> I reported - together with some sweet demo exploit. The issue was found with fuzzing being part of my recent <a href="http://blog.kotowicz.net/2011/04/how-to-upload-arbitrary-file-contents.html">file upload research</a>. And I still have some more to show in the future :)
</blockquote>
<p>
The issue, described in more detail <a href="http://bugs.php.net/bug.php?id=54939">here on bugs.php.net</a> (as of the time of this post, unfortunately unavailable) and his code to reproduce the issue is <a href="http://pastebin.com/1edSuSVN">here</a>. Due to a bug in the code that should strip down the upload to just the filename, certain kinds of file paths can make it through. The real problem comes in when an application blindly uses this filename to write to, possibly overwriting important files. You can see a screenshot of it in action <a href="http://www.youtube.com/watch?feature=player_embedded&v=hpsNOJq7tHM">here</a>.
</p>]]></description>
      <pubDate>Tue, 21 Jun 2011 08:44:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tobias Schlitt's Blog: My first patch to PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/5829</guid>
      <link>http://www.phpdeveloper.org/news/5829</link>
      <description><![CDATA[<p>
<i>Tobias Schlitt</i> mentions today in his <a href="http://schlitt.info/applications/blog/index.php?/archives/476-My-first-patch-to-PHP.html">latest post</a> about his first patch to PHP, an update to the pathinfo function's code being commited.
</p>
<blockquote>
Hehe, some might say, that those 10 lines of C code are not even worth calling it a patch. Especially, since it was mostly copy and paste work and since Christian Schneider also adviced me for some improvement. Anyway, Marcus just commited my enhancement to <a href="http://php.net/pathinfo">pathinfo()</a>, which adds a new field "filename" to the returned array of path elements.
</blockquote>
<p>
His <a href="http://schlitt.info/applications/blog/index.php?/archives/476-My-first-patch-to-PHP.html">patch</a> adds a much needed output parameter to the pathinfo function's results - filename. He talks briefly about the process of making the change and how long it took him on the first shot (2 hours), but now his hard work has paid off. The update will be a part of PHP 5.2. 
</p>]]></description>
      <pubDate>Wed, 19 Jul 2006 20:00:38 -0500</pubDate>
    </item>
  </channel>
</rss>
