Skip to content
Snippets Groups Projects
Commit e19e8efd authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2541094 by dawehner: Get rid of strtr in Html::getId()

parent d4679838
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -187,7 +187,7 @@ public static function getUniqueId($id) {
* @see self::getUniqueId()
*/
public static function getId($id) {
$id = strtr(Unicode::strtolower($id), array(' ' => '-', '_' => '-', '[' => '-', ']' => ''));
$id = str_replace([' ', '_', '[', ']'], ['-', '-', '-', ''], Unicode::strtolower($id));
// As defined in http://www.w3.org/TR/html4/types.html#type-name, HTML IDs can
// only contain letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment