On Fri, 2003-05-23 at 00:58, Timm Friebe wrote:
> On Fri, 2003-05-23 at 00:20, Timm Friebe wrote:
> > On Thu, 2003-05-22 at 23:44, Timm Friebe wrote:
> > [...]
> > > These patches to php_incomplete_class.h and var_unserializer.re, though
> > > not thoroughly tested, fix this.
> >
> > Here's a patch to php_incomplete_class.h with corrected whitespace. Some
> > lines were indented with spaces instead of tabs...
>
> While I'm at it: This patch also gets rid of memory leaks that occur
> when using the unserialize_callback_func ini directive.
And this one gets rid of *all* of them. Sorry for all the spam here:)
Test script used:
<?php
function autoload($fqcn) {
list($namespace, $class)= explode('::', $fqcn);
if ('power' == $namespace) {
eval('namespace '.$namespace.' { class '.$class.' {}}');
}
}
namespace Foo:Baz {
class Bar { }
}
class Baz { }
$bar= new Foo:Baz::Bar();
var_dump($bar, serialize($bar), unserialize(serialize($bar)));
$baz= new Baz();
var_dump(serialize($baz), unserialize(serialize($baz)));
var_dump(unserialize('O:7:"Binford":0:{}'));
ini_set('unserialize_callback_func', 'autoload');
var_dump(unserialize('O:14:"Power::Binford":0:{}'));
var_dump(unserialize('O:14:"Idiot::Binford":0:{}'));
?>
- Timm