Problem/Motivation

When a translatable string contains <front>, the \Drupal\locale\PoDatabaseWriter::importString reports an error, although this is a valid string in the Drupal world.

Proposed resolution

Remove that substring before testing the XSS filter.

Issue fork drupal-3473763

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jurgenhaas created an issue. See original summary.

jurgenhaas’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Know it's a small change but since it's kinda around the XSS Filter code can we add test coverage. Believe there is a data provider somewhere could just add a new case for

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

jurgenhaas’s picture

Status: Needs work » Needs review

I've now added a test and also rebased the MR to follow the refactoring underneath it, i.e. locale_string_is_safe got deprecated and moved to a service.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense with the one line. Can't imagine this breaking anything since it's just looking for

  • catch committed 5f50ce58 on 11.5.x
    fix: #3473763 locale_string_is_safe should accept "<front>" as being...

  • catch committed 5b339426 on 11.x
    fix: #3473763 locale_string_is_safe should accept "<front>" as being...

  • catch committed 015d03ed on 12.0.x
    fix: #3473763 locale_string_is_safe should accept "<front>" as being...

  • catch committed 1f24b84b on main
    fix: #3473763 locale_string_is_safe should accept "<front>" as being...
catch’s picture

Version: main » 11.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to main, 12.0.x, 11.x and 11.5.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.