Follow-up to #2506445: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests

Problem/Motivation

First step of #2506427: [meta] !placeholder causes strings to be escaped and makes the sanitization API harder to understand.

Proposed resolution

  • Replace !placeholder with @placeholder, in format_string()/SafeMarkup::format() usage only, excluding those used in URLs or non-html formats.

Bash command to use:

egrep -r '\format_string\(.*\!([a-zA-Z])+' * | grep -v 'href="!' | grep Test.php | grep -v "vendor" | grep -v ".js" | grep -v .css | grep -v "~" 

Remaining tasks

TBD

User interface changes

Ideally, fewer completely unexpected double-escaping bugs.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelpittet created an issue. See original summary.

xjm’s picture

Title: Replace !placeholder with @placeholder in format_string()/SafeMarkup::format() for non-URLs in tests » Replace !placeholder with @placeholder in format_string() for non-URLs
Issue summary: View changes
Status: Needs review » Active
xjm’s picture

Status: Active » Postponed

Postponing on #2506445: Replace !placeholder with @placeholder in t() and format_string() for non-URLs in tests since that one currently includes a bunch of format_string().

xjm’s picture

Issue summary: View changes
Status: Postponed » Active

This one can start now.

lauriii’s picture

Status: Active » Needs review
FileSize
1.78 KB

These were the only ones I could find

effulgentsia’s picture

Status: Needs review » Reviewed & tested by the community

Nice! I can't find any additional ones either, even with these much more permissive commands:

grep -r "SafeMarkup::format" * | grep "\'\!"
grep -r "format_string" * | grep "\'\!"
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed b1c52e8 and pushed to 8.0.x. Thanks!

  • alexpott committed b1c52e8 on 8.0.x
    Issue #2567855 by lauriii, xjm: Replace !placeholder with @placeholder...

Status: Fixed » Closed (fixed)

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