Mention relevant CR in an improved trigger_error() message in FormattableMarkup::placeholderFormat()

Created on 9 December 2016, about 8 years ago
Updated 17 August 2024, 5 months ago

Problem/Motivation

Follow-up to #2807705: FormattableMarkup::placeholderFormat() can result in unsafe replacements

Enhance trigger_error with an improved message and a link to the CR . Suggestion, courtesy of @alexpott:

elseif (strpos($string, $key) !== FALSE) {
  trigger_error("Fallthrough for unrecognised placeholders to %variable has been removed. See https://www.drupal.org/node/2605274. Invalid placeholder ($key) in string: $string', E_USER_DEPRECATED);
}

Steps to reproduce

Proposed resolution

Remaining tasks

Is this still needed? The message has changed to
trigger_error(sprintf('Placeholders must begin with one of the following "@", ":" or "%%", invalid placeholder (%s) with string: "%s"', $key, $string), E_USER_WARNING);

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component
Base 

Last updated about 4 hours ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024