[DeepClone] Reject malformed deepclone_from_array() input without warnings#627
Merged
Conversation
…nings A serialized class-name blob that does not unserialize() to an object is now rejected with a \ValueError instead of being stored and treated as an object. A PHP_INT_MIN reference id on the object-reference, named-closure and "prepared" paths no longer reaches -$id, which overflows to a float and emits a runtime warning before the error. Mirrors symfony/php-ext-deepclone#19.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the polyfill in line with the extension's handling of malformed
deepclone_from_array()payloads:unserialize()to an object (e.g. ani:,s:ora:form) is now rejected with a\ValueErrorinstead of being stored and treated as an object.PHP_INT_MINreference id on the object-reference, named-closure andpreparedpaths no longer reaches-$id, which overflows to a float and emits a runtime warning before the error. The hard-ref paths and the properties-loop object-ref path were already guarded; the remaining three sites now throw a clean\ValueErrortoo.Companion extension fix: symfony/php-ext-deepclone#19.