Repository navigation
[2.1] Fix upgrader charset_detected lookup - #9895
Merged
jdarwood007 merged 1 commit intoNov 16, 2026
Merged
Conversation
Signed-off-by: Shawn Bulen <bulens@pacbell.net>
Contributor
Author
|
I believe this addresses #8125 as well. |
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.
Last remaining fix for #9786
That logic is trying to make sure that you can do lookups in both $charsets and $lang_charsets based on the forum's primary language from Settings.php, $language. If found, it sets charset_detected.
It shouldn't be using charset_detected AS AN INPUT, because it's not set yet... It shouldn't be using lang_character_set either, because in 2.1 that will always be 'UTF-8', and will never tell us where we're moving FROM.
It's a two-level lookup... $lang_charsets translate from $language to encodings... $charsets translates from encodings to MySQL charsets. Ultimately we need the MySQL charset for the conversion. The intent of this was to make sure both lookups exist before setting charset_detected.
NOTE: There is no equivalent 3.0 fix yet, as the ability to upgrade from older versions of SMF hasn't been implemented. See #9120.
Test - Before this fix, a Ukrainian language lookup fails & the charset falls back to ISO-8859-1 & latin1, which is incorrect, resulting in mangled data:
Test - After this fix, the same Ukrainian language lookup properly finds Windows-1251 & cp1251: