Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate HTML tags in UI strings. #6720

Merged
merged 4 commits into from
Oct 2, 2020
Merged

Conversation

mkarolin
Copy link
Collaborator

Resolves brave/brave-browser#11767

Submitter Checklist:

Test Plan:

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

After-merge Checklist:

  • The associated issue milestone is set to the smallest version that the
    changes has landed on.
  • All relevant documentation has been updated.

@mkarolin mkarolin added this to the 1.16.x - Nightly milestone Sep 29, 2020
@mkarolin mkarolin self-assigned this Sep 29, 2020
@mkarolin mkarolin force-pushed the maxk-check-html-tags-in-strings branch 4 times, most recently from 9e60b3f to 6c4ec08 Compare October 1, 2020 21:29
@mkarolin mkarolin force-pushed the maxk-check-html-tags-in-strings branch 2 times, most recently from 446037d to 00f8ab8 Compare October 2, 2020 00:13
Changed the rebase script to automatically fix <a> links with
target="_blank" to also have rel="noopener noreferrer".

Modified transifex script to:

* Fix <a> links when pulling translations from local Chromium .xtb
files.

* Validate embedded HTML tags in strings against an allow list
  when uploading .grd(p) files to transifex.

* Do the same when downloading strings from Transifex.

* Completely strip all content from <ph> tags in .xtb files like
  Chromium does when pulling from Transifex.
@mkarolin mkarolin added the CI/skip Do not run CI builds (except noplatform) label Oct 2, 2020
@@ -782,7 +938,7 @@ def pull_xtb_without_transifex(grd_file_path, brave_source_root):
# A node's fingerprint changes if the desc or the meaning change
if (pre_text_node != textify(node) or
pre_meaning != meaning or
pre_desc == desc):
pre_desc != desc):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, nice find.

@mkarolin mkarolin marked this pull request as ready for review October 2, 2020 15:37
@mkarolin mkarolin merged commit 2bdee05 into master Oct 2, 2020
@mkarolin mkarolin deleted the maxk-check-html-tags-in-strings branch October 2, 2020 15:37
@diracdeltas
Copy link
Member

thanks @mkarolin !

mkarolin added a commit that referenced this pull request Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip Do not run CI builds (except noplatform)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lib/transifex.py should flag HTML tags
3 participants