Repository navigation
fix(i18n): escape translated HTML outside an allowlist and reject markup changes in translations - #571
Merged
vitormattos merged 1 commit intoNov 14, 2026
Conversation
…kup changes in translations Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
vitormattos
approved these changes
Nov 14, 2026
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.
Depends on #570 (based on its branch; the diff below is only this change).
Problem
source/faq.blade.phpprinted translated FAQ answers with{!! !!}, andpost_base.blade.phpprinted the translatedBy %sformat unescaped. Any HTML added in a translation was rendered as is on the localized pages.Changes
TranslatedHtmlSanitizerescapes the FAQ answer and only restores<a href="https://...">,</a>,<strong>and<em>. The current answers use only an HTTPS link.By %sformat, the author name and the profile URL before building the link.TranslationMarkupValidator, run bycomposer validate-translations, fails when the set of HTML tags and attribute names of a translation differs from its source.Validation
composer test: 98 tests passing, including the sanitizer and markup validator tests.composer validate-translationspasses on the current catalogs.",'); the author byline is unchanged.By %sand to a post body, the FAQ and byline render it escaped andcomposer validate-translationsreports the three entries.