Repository navigation
standard: Create incomplete objects again from the C format - #24020
Merged
kocsismate merged 1 commit intoSep 30, 2026
Merged
kocsismate merged 1 commit into
kocsismate merged 1 commit into
Conversation
Since phpGH-22046 was fixed, unserialize() fails as a whole when a `C` payload names a class that is missing or not in allowed_classes, because the __PHP_Incomplete_Class substituted for it has no unserializer either. The incomplete class has no internal state, so create an empty one as before and keep failing only for real classes that are not Serializable.
Contributor
Author
|
/cc @kocsismate |
ndossche
approved these changes
Sep 30, 2026
ndossche
left a comment
Member
There was a problem hiding this comment.
For me this is fine. Leaving final review for @kocsismate
kocsismate
approved these changes
Sep 30, 2026
kocsismate
added a commit
that referenced
this pull request
Sep 30, 2026
* PHP-8.6: standard: Create incomplete objects again from the `C` format (#24020)
nicolas-grekas
added a commit
to symfony/symfony
that referenced
this pull request
Sep 30, 2026
… bus name of an undecodable message (nicolas-grekas) This PR was merged into the 8.1 branch. Discussion ---------- [Messenger] Revert the PHP 8.6 workaround for reading the bus name of an undecodable message | Q | A | ------------- | --- | Branch? | 8.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT This reverts c6df1ae, the tokenizer that reads only the `BusNameStamp` list of a payload that failed to decode. It's needed only because PHP 8.6 fails to unserialize a payload holding a `C:` object of a class that is not allowed, and php/php-src#24020 fixes that. Pending on it: the "Unit Tests (8.6)" job stays red until the fix lands in the 8.6 builds. Commits ------- 75245e1 Revert "[Messenger] Fix reading the bus name of a message that fails to decode on PHP 8.6"
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.
Since #22058 (GH-22046),
unserialize()returns false as a whole when a payload holds aC:object of a class that is missing or not inallowed_classes: that class is replaced by__PHP_Incomplete_Class, which has no unserializer either. Up to 8.5, an empty incomplete object carrying the class name came back and the rest of the payload was decoded, soallowed_classescan't be used anymore to read such payloads. This happens in practice when a class that implementedSerializableis removed, see #18128.The incomplete class has no internal state, so creating an empty one is safe, and it's what the
O:format already does for it. Real classes that have no unserializer keep failing, as #22058 intended.