Skip to content

Fix #49649 - Handle property visibility changes on unserialization#2494

Closed
pmmaga wants to merge 1 commit into
php:masterfrom
pmmaga:bug-49649
Closed

Fix #49649 - Handle property visibility changes on unserialization#2494
pmmaga wants to merge 1 commit into
php:masterfrom
pmmaga:bug-49649

Conversation

@pmmaga

@pmmaga pmmaga commented Apr 22, 2017

Copy link
Copy Markdown
Contributor

Link for bugsnet: https://bugs.php.net/bug.php?id=49649

It shouldn't have any BC breaking effects. Any feedback on the implementation is welcome.

@pmmaga

pmmaga commented Jun 29, 2017

Copy link
Copy Markdown
Contributor Author

Rebased on fresh master and solved the conflicts. Travis failure is unrelated.

@krakjoe

krakjoe commented Jul 10, 2017

Copy link
Copy Markdown
Member

Merged 7cb5bdf

Thanks.

@krakjoe krakjoe closed this Jul 10, 2017
madmajestro added a commit to madmajestro/igbinary that referenced this pull request May 4, 2026
If the visibility of a property has changed between serialization and
unserialization, or if a private or protected property needs to be
restored, but the serialized data was generated by a __serialize method
while no __unserialize method exists in the class, the property value
cannot be found during hydration in the object's hash table. The reason
for this is that in these cases the property name in the serialized
representation does not match the prefixed/mangled property name of the
current class definition. To resolve this, an attempt is made to
determine the correctly prefixed property name by performing a lookup
with the unprefixed property name in the properties_info hash table
of the class. The implementation is borrowed from the current version of
php-src/ext/standard/var_unserializer.re to align the behavior to the
serializer of PHP >= 7.2. See 7cb5bdf64a95bd70623d33d6ea122c13b01113bd /
php/php-src#2494 for the initial implementation in PHP 7.2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants