<?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, 20 Mar 2010 04:19:20 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Pavel Shevaev's Blog: A reliable way to serialize/unserialize objects in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/9219</guid>
      <link>http://www.phpdeveloper.org/news/9219</link>
      <description><![CDATA[<p>
<i>Pavel Shevaev</i> has <a href="http://efiquest.org/?p=6">posted his method</a> (a reliable way) for serializing and unserializing objects in your applications:
</p>
<blockquote>
<p>
An experienced PHP developer might be wondering why posting this topic in a blog if PHP already has universal and almost transparent tools for this job [...] The key statement here is "almost transparent" which means you have to include all class definitions before invoking unserialize or use some __autoload schema.
</p>
<p>
The whole problem is due to the fact a serialized object has no idea about its class definition except the class name(the reason behind that is absolutely valid). [...] That's why I decided to hack up, hopefully, a more universal solution to this problem
</p>
</blockquote>
<p>
<a href="http://efiquest.org/?p=6">His method</a> contains things inside of a "serialization container" that automagically includes everything needed before it gets serialized. His code for the method is included as well as some examples of its use.
</p>]]></description>
      <pubDate>Tue, 11 Dec 2007 12:09:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Make Me Pulse Blog: Serialize and Unserialize SimpleXML in php]]></title>
      <guid>http://www.phpdeveloper.org/news/8747</guid>
      <link>http://www.phpdeveloper.org/news/8747</link>
      <description><![CDATA[<p>
From the "Make Me Pulse" blog (of <i>Nicolas Rajabaly</i> & <i>Antoine Ughetto</i>) there's a <a href="http://blog.makemepulse.com/2007/09/27/serialize-and-unserialize-simplexml-in-php/">quick example</a> of how to use serialized values with SimpleXML:
</p>
<blockquote>
Serialize is useful for storing or passing PHP values around without losing type and structure. But if you want to serialize a SimpleXml object, you will have some problem on unserialize with the error. [...] Replacing SimpleXMLObject with stdClass is a good idea but in this solution we loose all of attributes, and how can we make simplexml->xpath after?
</blockquote>
<p>
The solution? Serializing the XML content and then outputting it from the SimpleXML object as an XML string (to be stored). This process is reversed when the data is needed back out.
</p>]]></description>
      <pubDate>Fri, 28 Sep 2007 09:30:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Hardened-PHP Project: Advisory - PHP unserialize() Array Creation Integer Overflow]]></title>
      <guid>http://www.phpdeveloper.org/news/6456</guid>
      <link>http://www.phpdeveloper.org/news/6456</link>
      <description><![CDATA[<p>
The Hardened-PHP project has just released <a href="http://www.hardened-php.net/advisory_092006.133.html">another advisory</a> about core PHP functionality, specifically in the unserialize function when dealing with arrays.
</p>
<blockquote>
<p>
The PHP 5 branch of the PHP source code lacks the protection against possible integer overflows inside ecalloc() that is present in the PHP 4 branch and also for several years part of our Hardening-Patch and our new Suhosin-Patch.
</p>
<p>
It was discovered that such an integer overflow can be triggered when user input is passed to the unserialize() function. 
</p>
</blockquote>
<p>
You can get the full details from <a href="http://www.hardened-php.net/advisory_092006.133.html">this advisory release</a> including a recommendation to patch the installation until it is corrected in the current distribution.
</p>]]></description>
      <pubDate>Mon, 09 Oct 2006 13:41:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lukas Smith's Blog: To serialize or to not serialize?]]></title>
      <guid>http://www.phpdeveloper.org/news/5562</guid>
      <link>http://www.phpdeveloper.org/news/5562</link>
      <description><![CDATA[<p>
In <a href="http://pooteeweet.org/blog/413">his latest post</a>, <i>Lukas Smith</i> talks about serializing data - some of the pros and cons about it, as well as his experiences with it in the development of his own framework.
</p>
<quote>
<i>
<p>
In my own framework I have decided that there is plenty of structured data that I will never query on that I will just stick into the database as a serialized array. Now the other day I modified the auto type handling in MDB2's <a href="http://pear.php.net/package/MDB2/docs/latest/MDB2/MDB2_Driver_Common.html#methodquote">quote()</a> method to automatically serialize array's if no type is explicitly passed to the quote() method.
</p>
<p>
I send out a <a href="http://marc.theaimsgroup.com/?l=pear-dev&m=114841748412490&w=2">question</a> to pear-dev@ and it was not unanimously well received. So I sat down and pondered a more elegant approach. Actually there is already one approach implemented in MDB2 since ages.
</p>
</i>
</quote>
<p>
This implementation uses a seperate module that abuses PHP5's overloading functionality to integrate it easily. He also looked into another solution, however - creating a "datatype map" to help with the custom automatic serialization of datatypes (not just dependant on the variable type like before). Be sure to check out <a href="http://pooteeweet.org/blog/413#comments">the comments</a> for more thoughts on the subject, including validation of the custom datatypes.
</p>]]></description>
      <pubDate>Mon, 12 Jun 2006 06:01:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ilia Alshanetsky's Blog: Another unserialize() abuse]]></title>
      <guid>http://www.phpdeveloper.org/news/5032</guid>
      <link>http://www.phpdeveloper.org/news/5032</link>
      <description><![CDATA[With yet another reason not to trust the users of your application (mainly the data they send you), <i>Ilia Alshanetsky</i> has <a href="http://ilia.ws/archives/107-Another-unserialize-abuse.html">details on an issue</a> that could be caused by the unserialize() function in PHP.
<p>
<quote>
<i>
While talking with PHP developers this morning I thought of another way unverified serialized strings could be abused. This exploit can only affect PHP 5 installs though, but given the growing market share of PHP 5 it is certainly something worth noting.
<p>
As you may know classes in PHP are allowed to implement a magic method called __wakeup() that contains operation that are to be performed when a class is deserialized. Some native classes like PDO implement this function with a goal of preventing database serialization and throw an error when it is used.
</i>
</quote>
<p>
He <a href="http://ilia.ws/archives/107-Another-unserialize-abuse.html">uses an example with PDO</a> and a string of a serialized "supposed PDO object" to illustrate how, without the proper handling, it could lead to a fatal error in the script. The end result of the fatal error, if displaying errors is still on, could be that somewhat sensitive information could be displayed to the viewer.]]></description>
      <pubDate>Thu, 23 Mar 2006 06:59:23 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: Unserialize Yahoo! search results]]></title>
      <guid>http://www.phpdeveloper.org/news/4888</guid>
      <link>http://www.phpdeveloper.org/news/4888</link>
      <description><![CDATA[With <a href="http://www.phpdeveloper.org/news/4883">the announcement</a> of the new Yahoo! PHP Development Center, there's been a lot of buzz around the PHP community, including <a href="http://www.sitepoint.com/blogs/2006/02/23/unserialize-yahoo-search-results/">this new post</a> from <i>Harry Fuecks</i> over on the SitePoint PHP Blog today.
<p>
<quote>
<i>
Via <a href="http://wyome.com/blog/Yahoo%21_PHP_Development_Center">John Cox</a>, Yahoo! have opened up a <a href="http://developer.yahoo.net/blog/archives/2006/02/yahoo_releases.html">PHP Development Center</a> for their search APIs and, more interestingly, have started exposing their search data as serialized PHP strings. That's "serialized" as in the <a href="http://www.php.net/serialize">serialize</a> function.
<p>
This is very cool but think a little caution is needed when using it, given that it wasn't designed to be a wire format but rather for local storage of PHP data, within a trusted environment.
</i>
</quote>
<p>
In the rest of <a href="http://www.sitepoint.com/blogs/2006/02/23/unserialize-yahoo-search-results/">the post</a> he looks at a few different topics - whether it's inherently safe to use, a quick look at chatacter encoding, and an example of how to use the service with the <a href="http://pear.php.net/package/HTTP_Request">PEAR::HTTP_Request package</a>.]]></description>
      <pubDate>Thu, 23 Feb 2006 07:17:43 -0600</pubDate>
    </item>
  </channel>
</rss>
