Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3411111
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
drupal-3411111
Commits
d50941ce
Commit
d50941ce
authored
21 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Narrow the set of allowed usernames to prevent people from messing with it.
parent
d7b29e05
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
modules/user.module
+1
-2
1 addition, 2 deletions
modules/user.module
with
1 addition
and
2 deletions
modules/user.module
+
1
−
2
View file @
d50941ce
...
@@ -174,9 +174,8 @@ function user_validate_name($name) {
...
@@ -174,9 +174,8 @@ function user_validate_name($name) {
if
(
ereg
(
"^ "
,
$name
))
return
t
(
"The username cannot begin with a space."
);
if
(
ereg
(
"^ "
,
$name
))
return
t
(
"The username cannot begin with a space."
);
if
(
ereg
(
"
\$
"
,
$name
))
return
t
(
"The username cannot end with a space."
);
if
(
ereg
(
"
\$
"
,
$name
))
return
t
(
"The username cannot end with a space."
);
if
(
ereg
(
" "
,
$name
))
return
t
(
"The username cannot contain multiple spaces in a row."
);
if
(
ereg
(
" "
,
$name
))
return
t
(
"The username cannot contain multiple spaces in a row."
);
//
if (ereg("[^a-zA-Z0-9@-@]", $name)) return t("The username contains an illegal character.");
if
(
ereg
(
"[^
a-zA-Z0-9@-@]"
,
$name
))
return
t
(
"The username contains an illegal character."
);
if
(
ereg
(
'@'
,
$name
)
&&
!
eregi
(
'@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$'
,
$name
))
return
t
(
"The username is not a valid authentication ID."
);
if
(
ereg
(
'@'
,
$name
)
&&
!
eregi
(
'@([0-9a-z](-?[0-9a-z])*\.)+[a-z]{2}([zmuvtg]|fo|me)?$'
,
$name
))
return
t
(
"The username is not a valid authentication ID."
);
if
(
!
eregi
(
'^[[:print:]]+'
,
$name
))
return
t
(
"The name contains an illegal character."
);
if
(
strlen
(
$name
)
>
56
)
return
t
(
"The username '
$name
' is too long: it must be less than 56 characters."
);
if
(
strlen
(
$name
)
>
56
)
return
t
(
"The username '
$name
' is too long: it must be less than 56 characters."
);
}
}
...
...
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