Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002910 [Quercus] major always 09-05-08 19:25 09-05-08 19:27
Reporter koreth View Status public  
Assigned To nam
Priority normal Resolution fixed  
Status closed   Product Version 3.2.1
Summary 0002910: Quercus serialize/unserialize doesn't recognize protected and private field markers
Description <?php
class Foo {
  protected $blah = array();
  public function getBlah() { return $this->blah; }
  public function setBlah($blah) { $this->blah = $blah; }
}
$foo = new Foo();
$foo->setBlah(array(1, 2, 3));
print serialize($foo);

Plain PHP prints

    O:3:"Foo":1:{s:7:"^@*^@blah";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}

where the "^@" is a zero byte. Quercus prints

    O:3:"Foo":1:{s:4:"blah";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}

On unserialize, if it's fed the plain-PHP serialized object as input, Quercus doesn't populate the protected field:

<?php
class Foo {
  protected $blah = array();
  public function getBlah() { return $this->blah; }
  public function setBlah($blah) { $this->blah = $blah; }
}
$foo = unserialize("O:3:\"Foo\":1:{s:7:\"\x00*\x00blah\";a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}}");
print_r($foo->getBlah());

Plain PHP prints an array with 3 elements. Quercus prints an empty array.

The same problem exists with "private" fields, which are marked by null, the class name, and another null.
Additional Information
Attached Files

- Relationships

- Notes
(0003401)
nam
09-05-08 19:27

php/121r
php/1253
php/1254
php/1255
 

- Issue History
Date Modified Username Field Change
09-05-08 19:25 koreth New Issue
09-05-08 19:27 nam Status new => assigned
09-05-08 19:27 nam Assigned To  => nam
09-05-08 19:27 nam Status assigned => closed
09-05-08 19:27 nam Note Added: 0003401
09-05-08 19:27 nam Resolution open => fixed
09-05-08 19:27 nam Fixed in Version  => 3.2.1


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker