Skip to content
Snippets Groups Projects
Commit d1e5ea75 authored by Kaveri Biswas's avatar Kaveri Biswas Committed by Greg Knaddison
Browse files

Issue #3046085 by kavbiswa, imalabya, joachim: Update deprecated Unicode::* to mb_*

parent f6767d89
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@
* Allows users to register with an email address as their username.
*/
use Drupal\Component\Utility\Unicode;
use Drupal\user\UserInterface;
use Drupal\Core\Render\Element\Email;
use Drupal\Core\Form\FormStateInterface;
......@@ -115,7 +114,7 @@ function email_registration_cleanup_username($name) {
$name = ('' === $name) ? t('user') : $name;
// Truncate to a reasonable size.
$name = (Unicode::strlen($name) > (UserInterface::USERNAME_MAX_LENGTH - 10)) ? Unicode::substr($name, 0, UserInterface::USERNAME_MAX_LENGTH - 11) : $name;
$name = (mb_strlen($name) > (UserInterface::USERNAME_MAX_LENGTH - 10)) ? mb_substr($name, 0, UserInterface::USERNAME_MAX_LENGTH - 11) : $name;
return $name;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment