Require ext-mbstring, which the parser already needs - #278
Open
Amoifr wants to merge 1 commit into
Open
Conversation
CharacterReference::lookupDecimal() calls mb_decode_numericentity() with no guard, so a system without mbstring gets a fatal on an undefined function instead of being turned away by Composer. Declaring the extension makes the fallbacks in UTF8Utils unreachable, so countChars() keeps only mb_strlen() and convertToUTF8() only the branch it already preferred. The iconv path was reached only without mbstring, and never for the 'auto' encoding, where it threw instead.
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.
Fixes #203
CharacterReference::lookupDecimal()callsmb_decode_numericentity()with no guard, so a system without mbstring gets a fatal on an undefined function rather than being turned away by Composer. Declaring the extension does not restrict anything in practice, it makes an existing requirement visible.Once it is required, the fallbacks in
UTF8Utilsare unreachable, socountChars()keeps onlymb_strlen()andconvertToUTF8()only the branch it already preferred. The iconv path was reached only without mbstring, and never for theautoencoding, where it threw instead. TheExceptionimport goes with it.One thing from @alecpl's list is already done:
utf8_decode()is gone from the code base, so nothing is left to do there.167 tests green. The three PHPUnit deprecations are the same on
master. No CI job disables mbstring, so nothing depended on the removed branches.