Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
email_registration
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
email_registration
Commits
d1e5ea75
Commit
d1e5ea75
authored
6 years ago
by
Kaveri Biswas
Committed by
Greg Knaddison
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
email_registration.module
+1
-2
1 addition, 2 deletions
email_registration.module
with
1 addition
and
2 deletions
email_registration.module
+
1
−
2
View file @
d1e5ea75
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment