Mercurial > hg > isophonics-drupal-site
diff core/lib/Drupal/Component/Utility/Html.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
line wrap: on
line diff
--- a/core/lib/Drupal/Component/Utility/Html.php Tue Jul 10 15:07:59 2018 +0100 +++ b/core/lib/Drupal/Component/Utility/Html.php Thu Feb 28 13:21:36 2019 +0000 @@ -71,7 +71,7 @@ public static function getClass($class) { $class = (string) $class; if (!isset(static::$classes[$class])) { - static::$classes[$class] = static::cleanCssIdentifier(Unicode::strtolower($class)); + static::$classes[$class] = static::cleanCssIdentifier(mb_strtolower($class)); } return static::$classes[$class]; } @@ -79,9 +79,10 @@ /** * Prepares a string for use as a CSS identifier (element, class, or ID name). * - * http://www.w3.org/TR/CSS21/syndata.html#characters shows the syntax for - * valid CSS identifiers (including element names, classes, and IDs in - * selectors.) + * Link below shows the syntax for valid CSS identifiers (including element + * names, classes, and IDs in selectors). + * + * @see http://www.w3.org/TR/CSS21/syndata.html#characters * * @param string $identifier * The identifier to clean. @@ -124,7 +125,7 @@ // Identifiers cannot start with a digit, two hyphens, or a hyphen followed by a digit. $identifier = preg_replace([ '/^[0-9]/', - '/^(-[0-9])|^(--)/' + '/^(-[0-9])|^(--)/', ], ['_', '__'], $identifier); return $identifier; } @@ -215,7 +216,7 @@ * @see self::getUniqueId() */ public static function getId($id) { - $id = str_replace([' ', '_', '[', ']'], ['-', '-', '-', ''], Unicode::strtolower($id)); + $id = str_replace([' ', '_', '[', ']'], ['-', '-', '-', ''], mb_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 ("_"),