fix(packages): package installer fails with multibyte characters in readme - #84
Open
Ibochkarev wants to merge 2 commits into
Open
fix(packages): package installer fails with multibyte characters in readme#84Ibochkarev wants to merge 2 commits into
Ibochkarev wants to merge 2 commits into
Conversation
Convert supplementary-plane UTF-8 in transport package metadata and attributes to HTML entities only when the DB cannot store utf8mb4. Avoids mbstring and leaves utf8mb4 installs untouched.
Require utf8mb4 on both the metadata column and the MySQL connection before skipping emoji encoding, and assert entity conversion before INSERT in the regression test.
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.
Что сделано
Позволяет Package Management устанавливать Extras, чьи readme или метаданные содержат эмодзи (и другие символы вне BMP) на MySQL-базах, всё ещё использующих
utf8/utf8mb3.Когда колонки
metadata/attributesпакета не могут хранить utf8mb4,modTransportPackage::set()переписывает только валидные 4-байтовые UTF-8 последовательности в HTML-сущности (например🚀→🚀). utf8mb4-базы не трогаются. Конверсия не требуетmbstring.Зачем нужно
На не-utf8mb4 сайтах download/install падает с:
Метаданные провайдера и локальные атрибуты пакета оба идут через
set(), поэтому одна точка покрывает remote и загруженные пакеты. Перевод всего сайта на utf8mb4 по-прежнему работает; это изменение для установок, которые не могут или ещё не мигрировали. См. #16725 и подход entity-conversion из issue.Как проверить
utf8илиutf8mb3(не utf8mb4).Связанные
Refs modxcms#16725
Оригинал: modxcms#16837