Anonymous | Login | Signup for a new account | 12-17-2024 08:38 PST |
Main | My View | View Issues | Change Log | Docs |
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 | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |