Repository navigation
Conversation
…5 to 0xFF Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
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.
php_quot_print_encode()decides whether to insert a soft line break based on the byte being encoded. Bytes up to 0x7F and the UTF-8 lead and continuation bytes up to 0xF4 are covered, but bytes 0xF5 to 0xFF match no branch, so they never cause a break. A run of such bytes (or binary data that ends a line with one) produces lines longer than the 76 characters RFC 2045 allows:These bytes can not start a UTF-8 sequence, so this treats them like single bytes and breaks as soon as the encoded byte no longer fits on the line.
The decoded output is unchanged; only the placement of soft line breaks differs. Added a test covering 0xF5, 0xF8 and 0xFF.
Targets the lowest supported bugfix branch; the patch applies unchanged there.
Fixes #24441