Commit 154f2828 authored by catch's avatar catch

Issue #2849669 by alexpott, pwolanin, Munavijayalakshmi, dawehner: Fix...

Issue #2849669 by alexpott, pwolanin, Munavijayalakshmi, dawehner: Fix \Drupal\Component\Utility\Unicode() because of the Symfony mbstring polyfill
parent 2a7952f2
......@@ -46,7 +46,7 @@
*
* Correct:
* @code
* $my_substring = Unicode::substr($original_string, 0, 5);
* $my_substring = mb_substr($original_string, 0, 5);
* @endcode
*
* @}
......
......@@ -6,7 +6,6 @@
*/
use Drupal\Component\FileSystem\FileSystem as ComponentFileSystem;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Component\PhpStorage\FileStorage;
use Drupal\Component\Utility\Bytes;
......@@ -202,7 +201,7 @@ function file_create_url($uri) {
// HTTP and to https://example.com/bar.jpg when viewing a HTTPS page)
// Both types of relative URIs are characterized by a leading slash, hence
// we can use a single check.
if (Unicode::substr($uri, 0, 1) == '/') {
if (mb_substr($uri, 0, 1) == '/') {
return $uri;
}
else {
......
......@@ -12,7 +12,6 @@
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Html;
use Drupal\Component\Render\MarkupInterface;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Config\Config;
use Drupal\Core\Config\StorageException;
......@@ -485,7 +484,7 @@ function theme_settings_convert_to_config(array $theme_settings, Config $config)
$config->set('favicon.mimetype', $value);
}
elseif (substr($key, 0, 7) == 'toggle_') {
$config->set('features.' . Unicode::substr($key, 7), $value);
$config->set('features.' . mb_substr($key, 7), $value);
}
elseif (!in_array($key, ['theme', 'logo_upload'])) {
$config->set($key, $value);
......
......@@ -5,7 +5,6 @@
* Theming for maintenance pages.
*/
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Site\Settings;
/**
......@@ -29,7 +28,6 @@ function _drupal_maintenance_theme() {
require_once __DIR__ . '/file.inc';
require_once __DIR__ . '/module.inc';
require_once __DIR__ . '/database.inc';
Unicode::check();
// Install and update pages are treated differently to prevent theming overrides.
if (defined('MAINTENANCE_MODE') && (MAINTENANCE_MODE == 'install' || MAINTENANCE_MODE == 'update')) {
......
......@@ -2,8 +2,6 @@
namespace Drupal\Component\Diff\Engine;
use Drupal\Component\Utility\Unicode;
/**
* Class used internally by Diff to actually compute the diffs.
*
......@@ -134,7 +132,7 @@ public function diff($from_lines, $to_lines) {
* Returns the whole line if it's small enough, or the MD5 hash otherwise.
*/
protected function _line_hash($line) {
if (Unicode::strlen($line) > $this::MAX_XREF_LENGTH) {
if (mb_strlen($line) > $this::MAX_XREF_LENGTH) {
return md5($line);
}
else {
......
......@@ -2,8 +2,6 @@
namespace Drupal\Component\Diff\Engine;
use Drupal\Component\Utility\Unicode;
/**
* Additions by Axel Boldt follow, partly taken from diff.php, phpwiki-1.3.3
*/
......@@ -64,7 +62,7 @@ public function addWords($words, $tag = '') {
}
if ($word[0] == "\n") {
$this->_flushLine($tag);
$word = Unicode::substr($word, 1);
$word = mb_substr($word, 1);
}
assert(!strstr($word, "\n"));
$this->group .= $word;
......
......@@ -3,7 +3,6 @@
namespace Drupal\Component\Diff;
use Drupal\Component\Diff\Engine\HWLDFWordAccumulator;
use Drupal\Component\Utility\Unicode;
/**
* @todo document
......@@ -35,7 +34,7 @@ protected function _split($lines) {
$words[] = "\n";
$stripped[] = "\n";
}
if (Unicode::strlen($line) > $this::MAX_LINE_LENGTH) {
if (mb_strlen($line) > $this::MAX_LINE_LENGTH) {
$words[] = $line;
$stripped[] = $line;
}
......
......@@ -6,7 +6,7 @@
"license": "GPL-2.0-or-later",
"require": {
"php": ">=5.5.9",
"drupal/core-utility": "^8.2"
"symfony/polyfill-mbstring": "~1.0"
},
"autoload": {
"psr-4": {
......
......@@ -3,7 +3,6 @@
namespace Drupal\Component\Render;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\UrlHelper;
/**
......@@ -107,7 +106,7 @@ public function __toString() {
* The length of the string.
*/
public function count() {
return Unicode::strlen($this->string);
return mb_strlen($this->string);
}
/**
......
......@@ -3,7 +3,6 @@
namespace Drupal\Component\Render;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
/**
* Escapes HTML syntax characters to HTML entities for display in markup.
......@@ -43,7 +42,7 @@ public function __toString() {
* {@inheritdoc}
*/
public function count() {
return Unicode::strlen($this->string);
return mb_strlen($this->string);
}
/**
......
......@@ -2,8 +2,6 @@
namespace Drupal\Component\Render;
use Drupal\Component\Utility\Unicode;
/**
* Implements MarkupInterface and Countable for rendered objects.
*
......@@ -61,7 +59,7 @@ public function __toString() {
* The length of the string.
*/
public function count() {
return Unicode::strlen($this->string);
return mb_strlen($this->string);
}
/**
......
......@@ -23,7 +23,7 @@ public static function validateHex($hex) {
// Hash prefix is optional.
$hex = ltrim($hex, '#');
// Must be either RGB or RRGGBB.
$length = Unicode::strlen($hex);
$length = mb_strlen($hex);
$valid = $valid && ($length === 3 || $length === 6);
// Must be a valid hex value.
$valid = $valid && ctype_xdigit($hex);
......
......@@ -71,7 +71,7 @@ class Html {
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];
}
......@@ -215,7 +215,7 @@ public static function getUniqueId($id) {
* @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 ("_"),
......
......@@ -7,7 +7,9 @@
"require": {
"php": ">=5.5.9",
"paragonie/random_compat": "^1.0|^2.0",
"drupal/core-render": "^8.2"
"drupal/core-render": "^8.2",
"symfony/polyfill-iconv": "~1.0",
"symfony/polyfill-mbstring": "~1.0"
},
"autoload": {
"psr-4": {
......
......@@ -119,7 +119,7 @@ public function loadFile($file, $optimize = NULL, $reset_basepath = TRUE) {
// If a BOM is found, convert the file to UTF-8, then use substr() to
// remove the BOM from the result.
if ($encoding = (Unicode::encodingFromBOM($contents))) {
$contents = Unicode::substr(Unicode::convertToUtf8($contents, $encoding), 1);
$contents = mb_substr(Unicode::convertToUtf8($contents, $encoding), 1);
}
// If no BOM, check for fallback encoding. Per CSS spec the regex is very strict.
elseif (preg_match('/^@charset "([^"]+)";/', $contents, $matches)) {
......
......@@ -24,7 +24,7 @@ public function optimize(array $js_asset) {
// remove the BOM from the result.
$data = file_get_contents($js_asset['data']);
if ($encoding = (Unicode::encodingFromBOM($data))) {
$data = Unicode::substr(Unicode::convertToUtf8($data, $encoding), 1);
$data = mb_substr(Unicode::convertToUtf8($data, $encoding), 1);
}
// If no BOM is found, check for the charset attribute.
elseif (isset($js_asset['attributes']['charset'])) {
......
......@@ -7,7 +7,6 @@
use Drupal\Core\Messenger\MessengerTrait;
use Drupal\Core\Plugin\ContextAwarePluginAssignmentTrait;
use Drupal\Core\Plugin\ContextAwarePluginBase;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Plugin\PluginWithFormsInterface;
......@@ -246,7 +245,7 @@ public function getMachineNameSuggestion() {
// \Drupal\system\MachineNameController::transliterate(), so it might make
// sense to provide a common service for the two.
$transliterated = $this->transliteration()->transliterate($admin_label, LanguageInterface::LANGCODE_DEFAULT, '_');
$transliterated = Unicode::strtolower($transliterated);
$transliterated = mb_strtolower($transliterated);
$transliterated = preg_replace('@[^a-z0-9_.]+@', '', $transliterated);
......
......@@ -3,7 +3,6 @@
namespace Drupal\Core\Config;
use Drupal\Component\Utility\Crypt;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\Entity\ConfigDependencyManager;
use Drupal\Core\Config\Entity\ConfigEntityDependency;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
......@@ -344,7 +343,7 @@ public function installCollectionDefaultConfig($collection) {
// Only install configuration for enabled extensions.
$enabled_extensions = $this->getEnabledExtensions();
$config_to_install = array_filter($storage->listAll(), function ($config_name) use ($enabled_extensions) {
$provider = Unicode::substr($config_name, 0, strpos($config_name, '.'));
$provider = mb_substr($config_name, 0, strpos($config_name, '.'));
return in_array($provider, $enabled_extensions);
});
if (!empty($config_to_install)) {
......
......@@ -2,7 +2,6 @@
namespace Drupal\Core\Config\Entity\Query;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\Query\ConditionBase;
use Drupal\Core\Entity\Query\ConditionInterface;
use Drupal\Core\Entity\Query\QueryException;
......@@ -32,10 +31,10 @@ public function compile($configs) {
// Lowercase condition value(s) for case-insensitive matches.
if (is_array($condition['value'])) {
$condition['value'] = array_map('Drupal\Component\Utility\Unicode::strtolower', $condition['value']);
$condition['value'] = array_map('mb_strtolower', $condition['value']);
}
elseif (!is_bool($condition['value'])) {
$condition['value'] = Unicode::strtolower($condition['value']);
$condition['value'] = mb_strtolower($condition['value']);
}
$single_conditions[] = $condition;
......@@ -164,7 +163,7 @@ protected function match(array $condition, $value) {
if (isset($value)) {
// We always want a case-insensitive match.
if (!is_bool($value)) {
$value = Unicode::strtolower($value);
$value = mb_strtolower($value);
}
switch ($condition['operator']) {
......
......@@ -212,7 +212,7 @@ protected function processField($field) {
// Set the correct database-engine specific datatype.
// In case one is already provided, force it to uppercase.
if (isset($field['mysql_type'])) {
$field['mysql_type'] = Unicode::strtoupper($field['mysql_type']);
$field['mysql_type'] = mb_strtoupper($field['mysql_type']);
}
else {
$map = $this->getFieldTypeMap();
......
......@@ -2,7 +2,6 @@
namespace Drupal\Core\Database\Driver\pgsql;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\SchemaObjectDoesNotExistException;
use Drupal\Core\Database\Schema as DatabaseSchema;
......@@ -350,7 +349,7 @@ protected function processField($field) {
// Set the correct database-engine specific datatype.
// In case one is already provided, force it to lowercase.
if (isset($field['pgsql_type'])) {
$field['pgsql_type'] = Unicode::strtolower($field['pgsql_type']);
$field['pgsql_type'] = mb_strtolower($field['pgsql_type']);
}
else {
$map = $this->getFieldTypeMap();
......
......@@ -2,7 +2,6 @@
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\SchemaObjectDoesNotExistException;
use Drupal\Core\Database\Schema as DatabaseSchema;
......@@ -131,7 +130,7 @@ protected function processField($field) {
// Set the correct database-engine specific datatype.
// In case one is already provided, force it to uppercase.
if (isset($field['sqlite_type'])) {
$field['sqlite_type'] = Unicode::strtoupper($field['sqlite_type']);
$field['sqlite_type'] = mb_strtoupper($field['sqlite_type']);
}
else {
$map = $this->getFieldTypeMap();
......
......@@ -375,7 +375,8 @@ protected function mapConditionOperator($operator) {
}
else {
// We need to upper case because PHP index matches are case sensitive but
// do not need the more expensive Unicode::strtoupper() because SQL statements are ASCII.
// do not need the more expensive mb_strtoupper() because SQL statements
// are ASCII.
$operator = strtoupper($operator);
$return = isset(static::$conditionOperatorMap[$operator]) ? static::$conditionOperatorMap[$operator] : [];
}
......
......@@ -5,7 +5,6 @@
use Composer\Autoload\ClassLoader;
use Drupal\Component\Assertion\Handle;
use Drupal\Component\FileCache\FileCacheFactory;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\UrlHelper;
use Drupal\Core\Cache\DatabaseBackend;
use Drupal\Core\Config\BootstrapConfigStorageFactory;
......@@ -1000,8 +999,9 @@ public static function bootEnvironment($app_root = NULL) {
// numbers handling.
setlocale(LC_ALL, 'C');
// Detect string handling method.
Unicode::check();
// Set appropriate configuration for multi-byte strings.
mb_internal_encoding('utf-8');
mb_language('uni');
// Indicate that code is operating in a test child site.
if (!defined('DRUPAL_TEST_IN_CHILD_SITE')) {
......
......@@ -5,7 +5,6 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\RefinableCacheableDependencyTrait;
use Drupal\Core\DependencyInjection\DependencySerializationTrait;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Config\Entity\Exception\ConfigEntityIdLengthException;
use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException;
use Drupal\Core\Language\Language;
......@@ -431,7 +430,7 @@ public function preSave(EntityStorageInterface $storage) {
// Check if this is an entity bundle.
if ($this->getEntityType()->getBundleOf()) {
// Throw an exception if the bundle ID is longer than 32 characters.
if (Unicode::strlen($this->id()) > EntityTypeInterface::BUNDLE_MAX_LENGTH) {
if (mb_strlen($this->id()) > EntityTypeInterface::BUNDLE_MAX_LENGTH) {
throw new ConfigEntityIdLengthException("Attempt to create a bundle with an ID longer than " . EntityTypeInterface::BUNDLE_MAX_LENGTH . " characters: $this->id().");
}
}
......
......@@ -3,7 +3,6 @@
namespace Drupal\Core\Entity;
use Drupal\Component\Plugin\Definition\PluginDefinition;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\Exception\EntityTypeIdLengthException;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslatableMarkup;
......@@ -295,7 +294,7 @@ class EntityType extends PluginDefinition implements EntityTypeInterface {
*/
public function __construct($definition) {
// Throw an exception if the entity type ID is longer than 32 characters.
if (Unicode::strlen($definition['id']) > static::ID_MAX_LENGTH) {
if (mb_strlen($definition['id']) > static::ID_MAX_LENGTH) {
throw new EntityTypeIdLengthException('Attempt to create an entity type with an ID longer than ' . static::ID_MAX_LENGTH . " characters: {$definition['id']}.");
}
......@@ -768,7 +767,7 @@ public function getLabel() {
* {@inheritdoc}
*/
public function getLowercaseLabel() {
return Unicode::strtolower($this->getLabel());
return mb_strtolower($this->getLabel());
}
/**
......
......@@ -3,7 +3,6 @@
namespace Drupal\Core\Entity\Plugin\EntityReferenceSelection;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
/**
* Defines an alternative to the default Entity Reference Selection plugin.
......@@ -35,11 +34,11 @@ public function getReferenceableEntities($match = NULL, $match_operator = 'CONTA
// possible.
// @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface::getReferenceableEntities()
if (is_string($match)) {
$match = Html::escape(Unicode::strtolower($match));
$match = Html::escape(mb_strtolower($match));
}
elseif (is_array($match)) {
array_walk($match, function (&$item) {
$item = Html::escape(Unicode::strtolower($item));
$item = Html::escape(mb_strtolower($item));
});
}
......@@ -89,7 +88,7 @@ public function countReferenceableEntities($match = NULL, $match_operator = 'CON
*/
protected function matchLabel($match, $match_operator, $label) {
// Always use a case-insensitive value.
$label = Unicode::strtolower($label);
$label = mb_strtolower($label);
switch ($match_operator) {
case '=':
......@@ -113,7 +112,7 @@ protected function matchLabel($match, $match_operator, $label) {
case 'CONTAINS':
return strpos($label, $match) !== FALSE;
case 'ENDS_WITH':
return Unicode::substr($label, -Unicode::strlen($match)) === (string) $match;
return mb_substr($label, -mb_strlen($match)) === (string) $match;
case 'IS NOT NULL':
return TRUE;
case 'IS NULL':
......
......@@ -2,7 +2,6 @@
namespace Drupal\Core\Field\Plugin\Field\FieldType;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\TypedData\DataDefinition;
......@@ -81,7 +80,7 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin
$values = parent::generateSampleValue($field_definition);
$suffix_length = $field_definition->getSetting('max_length') - 7;
foreach ($values as $key => $value) {
$values[$key] = 'http://' . Unicode::substr($value, 0, $suffix_length);
$values[$key] = 'http://' . mb_substr($value, 0, $suffix_length);
}
return $values;
}
......
......@@ -3,7 +3,6 @@
namespace Drupal\Core\Form;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Access\CsrfTokenGenerator;
use Drupal\Core\Render\Element;
use Drupal\Core\StringTranslation\StringTranslationTrait;
......@@ -259,7 +258,7 @@ protected function doValidateForm(&$elements, FormStateInterface &$form_state, $
// string '0', which could be a valid value.
$is_countable = is_array($elements['#value']) || $elements['#value'] instanceof \Countable;
$is_empty_multiple = $is_countable && count($elements['#value']) == 0;
$is_empty_string = (is_string($elements['#value']) && Unicode::strlen(trim($elements['#value'])) == 0);
$is_empty_string = (is_string($elements['#value']) && mb_strlen(trim($elements['#value'])) == 0);
$is_empty_value = ($elements['#value'] === 0);
$is_empty_null = is_null($elements['#value']);
if ($is_empty_multiple || $is_empty_string || $is_empty_value || $is_empty_null) {
......@@ -331,8 +330,8 @@ protected function doValidateForm(&$elements, FormStateInterface &$form_state, $
*/
protected function performRequiredValidation(&$elements, FormStateInterface &$form_state) {
// Verify that the value is not longer than #maxlength.
if (isset($elements['#maxlength']) && Unicode::strlen($elements['#value']) > $elements['#maxlength']) {
$form_state->setError($elements, $this->t('@name cannot be longer than %max characters but is currently %length characters long.', ['@name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'], '%max' => $elements['#maxlength'], '%length' => Unicode::strlen($elements['#value'])]));
if (isset($elements['#maxlength']) && mb_strlen($elements['#value']) > $elements['#maxlength']) {
$form_state->setError($elements, $this->t('@name cannot be longer than %max characters but is currently %length characters long.', ['@name' => empty($elements['#title']) ? $elements['#parents'][0] : $elements['#title'], '%max' => $elements['#maxlength'], '%length' => mb_strlen($elements['#value'])]));
}
if (isset($elements['#options']) && isset($elements['#value'])) {
......
......@@ -3,7 +3,6 @@
namespace Drupal\Core;
use Drupal\Component\Render\MarkupInterface;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Render\BubbleableMetadata;
/**
......@@ -66,7 +65,7 @@ public function jsonSerialize() {
* {@inheritdoc}
*/
public function count() {
return Unicode::strlen($this->__toString());
return mb_strlen($this->__toString());
}
}
......@@ -3,7 +3,6 @@
namespace Drupal\Core\Mail;
use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Unicode;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Site\Settings;
......@@ -222,12 +221,12 @@ public static function htmlToText($string, $allowed_tags = NULL) {
// Fancy headers.
case 'h1':
$indent[] = '======== ';
$casing = '\Drupal\Component\Utility\Unicode::strtoupper';
$casing = 'mb_strtoupper';
break;
case 'h2':
$indent[] = '-------- ';
$casing = '\Drupal\Component\Utility\Unicode::strtoupper';
$casing = 'mb_strtoupper';
break;
case '/h1':
......@@ -260,7 +259,7 @@ public static function htmlToText($string, $allowed_tags = NULL) {
// Convert inline HTML text to plain text; not removing line-breaks or
// white-space, since that breaks newlines when sanitizing plain-text.
$value = trim(Html::decodeEntities($value));
if (Unicode::strlen($value)) {
if (mb_strlen($value)) {
$chunk = $value;
}
}
......
......@@ -4,7 +4,6 @@
use Drupal\Component\Annotation\AnnotationInterface;
use Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery as ComponentAnnotatedClassDiscovery;
use Drupal\Component\Utility\Unicode;
/**
* Defines a discovery mechanism to find annotated plugins in PSR-0 namespaces.
......@@ -103,7 +102,7 @@ protected function getProviderFromNamespace($namespace) {
preg_match('|^Drupal\\\\(?<provider>[\w]+)\\\\|', $namespace, $matches);
if (isset($matches['provider'])) {
return Unicode::strtolower($matches['provider']);
return mb_strtolower($matches['provider']);
}
return NULL;
......
......@@ -2,7 +2,6 @@
namespace Drupal\Core\Routing;
use Drupal\Component\Utility\Unicode;
use Symfony\Component\Routing\CompiledRoute as SymfonyCompiledRoute;
/**
......@@ -69,7 +68,7 @@ public function __construct($fit, $pattern_outline, $num_parts, $staticPrefix, $
// Support case-insensitive route matching by ensuring the pattern outline
// is lowercase.
// @see \Drupal\Core\Routing\RouteProvider::getRoutesByPath()
$this->patternOutline = Unicode::strtolower($pattern_outline);
$this->patternOutline = mb_strtolower($pattern_outline);
$this->numParts = $num_parts;
}
......
......@@ -2,7 +2,6 @@
namespace Drupal\Core\Routing;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
......@@ -345,7 +344,7 @@ protected function getRoutesByPath($path) {
// have a case-insensitive match from the incoming path to the lower case
// pattern outlines from \Drupal\Core\Routing\RouteCompiler::compile().
// @see \Drupal\Core\Routing\CompiledRoute::__construct()
$parts = preg_split('@/+@', Unicode::strtolower($path), NULL, PREG_SPLIT_NO_EMPTY);
$parts = preg_split('@/+@', mb_strtolower($path), NULL, PREG_SPLIT_NO_EMPTY);
$collection = new RouteCollection();
......
......@@ -4,7 +4,6 @@
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Component\Utility\ToStringTrait;
use Drupal\Component\Utility\Unicode;
/**
* Provides translatable markup class.
......@@ -226,7 +225,7 @@ protected function getStringTranslation() {
* The length of the string.
*/
public function count() {
return Unicode::strlen($this->render());
return mb_strlen($this->render());
}
}
......@@ -87,7 +87,7 @@ public function getString() {
$strings[] = $item->getString();
}
// Remove any empty strings resulting from empty items.
return implode(', ', array_filter($strings, '\Drupal\Component\Utility\Unicode::strlen'));
return implode(', ', array_filter($strings, 'mb_strlen'));
}
/**
......
......@@ -100,7 +100,7 @@ public function getString() {
$strings[] = $property->getString();
}
// Remove any empty strings resulting from empty items.
return implode(', ', array_filter($strings, '\Drupal\Component\Utility\Unicode::strlen'));
return implode(', ', array_filter($strings, 'mb_strlen'));