Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / user / src / Plugin / Validation / Constraint / UserNameConstraintValidator.php
index 9e4776bdcaf80fcc97baf1b25e8a5efd4f191116..7e41ed15cd292f124541f196a23d30fd54778501 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Drupal\user\Plugin\Validation\Constraint;
 
-use Drupal\Component\Utility\Unicode;
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\ConstraintValidator;
 
@@ -53,7 +52,7 @@ class UserNameConstraintValidator extends ConstraintValidator {
     ) {
       $this->context->addViolation($constraint->illegalMessage);
     }
-    if (Unicode::strlen($name) > USERNAME_MAX_LENGTH) {
+    if (mb_strlen($name) > USERNAME_MAX_LENGTH) {
       $this->context->addViolation($constraint->tooLongMessage, ['%name' => $name, '%max' => USERNAME_MAX_LENGTH]);
     }
   }