[ticket/16708] Update the UTF-8 check for multiple encoding settings#6144
Open
EA117 wants to merge 2 commits intophpbb:3.3.xfrom
EA117:ticket/16708
Open
[ticket/16708] Update the UTF-8 check for multiple encoding settings#6144EA117 wants to merge 2 commits intophpbb:3.3.xfrom EA117:ticket/16708
EA117 wants to merge 2 commits intophpbb:3.3.xfrom
EA117:ticket/16708
Conversation
Update the mbstring.http_input and mbstring.http_output configuration check, from being the deprecated PHP 5.6.x "PASS, or blank" to now be "UTF-8, or blank". PHP documentation specifies this configuration should be left blank, in order to inherit default_charset, which phpBB requires to be configured as UTF-8. For a phpBB customer where mbstring.http_input and mbstring.http_output is set to UTF-8 rather than being left blank, and is a shared hosting configuration that the customer isn't permitted to change, the phpBB ACP warning that "your http_input/http_output configuration is invalid" isn't helpful. Their setting is UTF-8, which is the encoding http_input/http_output would be using if it had been left blank and allowed to inherit default_charset. Our "warning" isn't advising the user of a misconfiguration which is causing a phpBB functionality problem. phpBB is getting exactly the UTF-8 encoding it was intending to get; same as when it was checking whether the setting was left blank, too. Also update the default_charset test to permit "UTF-8, or blank". This had been correctly changed to effectively test "UTF-8, or NULL" during PHPBB3-16698, based on code inspection of /vendor/bantu/ini-get-wrapper/src/IniGetWrapper.php which confirmed IniGetWrapper::getString() will return NULL for any setting which does not exist. However, testing on some PHP platforms shows PHP itself returning an empty string for a parameter which isn't defined in the PHP.INI, and so we receive an empty string instead of NULL. So the test was updated so that we effectively check for "UTF-8, or blank, or NULL", all of which result in UTF-8 being used. PHPBB3-16708
rxu
reviewed
Feb 25, 2021
CHItA
requested changes
Feb 25, 2021
Fixed short array syntax, moved testing logic into member helper function. PHPBB3-16708
Contributor
|
I am not a fan of this changes. |
|
@marc1706: What do you think about this PR? |
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.
Checklist:
https://tracker.phpbb.com/browse/PHPBB3-16708