-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot deserialize nested serialization with associative arrays #10
Comments
Nice one... the problem with
results in
Current matched pattern groups looks like this → https://regex101.com/r/3Bbktq/1 Thus, the inner result of |
Thanks for the detailed description and the follow up. 👍 |
i think this requires a way more complex solution that is not only able to recognize serialized objects but scalar values and arrays as well. to tackle that a recursive solution would be my first choice. in every iteration we need to recognize the next level properties with their types ( this approach would eliminate wrongly parsed objects if they are part of a string property, but like i said: way more complex maybe there's a better way 🤷♂️ |
Thanks @ohader for your PR. I'll have a look on Friday. It looks really promising. 👍 Thanks for putting so much work into it. I am thinking about making this a 2.0, rather than a 1.1 or 1.0.5, due to the major change it introduces in the code and to make sure it will not have a side effect on people who don't run into this issue right now. I will add a note to the known bugs in the 1.x-branch and people can decide whether this is an issue for them or not. Let me know if this sounds like a good idea for you or if you would rather have this as a 1.x release to make sure people will get the bugfix with a regular |
@dbrumann Lots of people and projects are taking benefits from this unserialize polyfill (so does My assumptions for this change were:
Usually I would have used more objects like some |
From my point of view a |
I have just released v2.0.0 and it's already available via packagist. Thanks again for you contribution. |
Hello,
we encounter an issue where deserialization of a string fails that has nested serialized objects and the most inner one is an associative array. This issue occurs in PHP 5.6, unfortunately, we cannot test older releases.
Example serialization:
Deserialization fails with the following messages:
I've added the
poc.php
andcomposer.json
files as archive to this ticket: broken-deserialize-poc.zipKind regards
Andreas
The text was updated successfully, but these errors were encountered: