Skip to content

[2.1] Upgrader - Fix issues with json conversion#9271

Open
sbulen wants to merge 2 commits into
SimpleMachines:release-2.1from
sbulen:21_upgr_fix_unserialize
Open

[2.1] Upgrader - Fix issues with json conversion#9271
sbulen wants to merge 2 commits into
SimpleMachines:release-2.1from
sbulen:21_upgr_fix_unserialize

Conversation

@sbulen

@sbulen sbulen commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Partial for #9259

The json conversion step had some issues.

  • Due to a typo, safe_unserialize() string fixes were never applied.
  • json_encode can ONLY work on UTF8. Nothing else. Anytime a non-utf8 character was passed, the json_encode would fail & return false.
  • The result was not checked, & "false" was passed to updates, which, for example, might tell updateSettings() to decrement the value of the setting. MariaDB would crash rather than comply; MySQL would change affected settings to -1, e.g., memberlist_cache.
  • The json conversion occurs before the UTF8 conversion... So this would happen even in latin1 databases (umlauts & accents, etc.).

The net result is that many strings were either not converted or blanked out. Settings might be affected, e.g,. memberlist_cache. Most of the issues were with various logs, e.g., log_actions. qanda. Places where user-entered text ended up in a serialized string.

I use a simple "cheezy 2.1 encoding" technique to preserve the non-utf8 strings across json_encode. (Trademark pending.) Got a better idea, let me know... But it works. The UTF8 conversion, which comes later, works as desired & the content is properly migrated to UTF8.

This one is ready to go. If approved, I'll work on the 3.0 version.

sbulen added 2 commits June 14, 2026 14:43
Signed-off-by: Shawn Bulen <bulens@pacbell.net>
Signed-off-by: Shawn Bulen <bulens@pacbell.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant