|
Mantis - Quercus
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 2910 | major | always | 09-05-08 19:25 | 09-05-08 19:27 | |
|
|
|||||
| Reporter: | koreth | Platform: | |||
| Assigned To: | nam | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 3.2.1 | ||
| Product Build: | Resolution: | fixed | |||
| Projection: | none | ||||
| ETA: | none | Fixed in 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. |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: | |||||
| Notes | |||||
|
|
|||||
|
|
||||