Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f2984813
Commit
f2984813
authored
Sep 24, 2004
by
Steven Wittens
Browse files
- user.module: allow non-ascii usernames.
parent
4d248534
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/user.module
View file @
f2984813
...
...
@@ -177,7 +177,7 @@ function user_validate_name($name) {
if
(
substr
(
$name
,
0
,
1
)
==
' '
)
return
t
(
'The username cannot begin with a space.'
);
if
(
substr
(
$name
,
-
1
)
==
' '
)
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
(
'
[^ [:alnum:]@_.-]
'
,
$name
))
return
t
(
'The username contains an illegal character.'
);
if
(
ereg
(
"
[^
\x80
-
\xF7
[:alnum:]@_.-]
"
,
$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
(
strlen
(
$name
)
>
56
)
return
t
(
'The username %name is too long: it must be less than 56 characters.'
,
array
(
'%name'
=>
"<em>
$name
</em>"
));
}
...
...
modules/user/user.module
View file @
f2984813
...
...
@@ -177,7 +177,7 @@ function user_validate_name($name) {
if
(
substr
(
$name
,
0
,
1
)
==
' '
)
return
t
(
'The username cannot begin with a space.'
);
if
(
substr
(
$name
,
-
1
)
==
' '
)
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
(
'
[^ [:alnum:]@_.-]
'
,
$name
))
return
t
(
'The username contains an illegal character.'
);
if
(
ereg
(
"
[^
\x80
-
\xF7
[:alnum:]@_.-]
"
,
$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
(
strlen
(
$name
)
>
56
)
return
t
(
'The username %name is too long: it must be less than 56 characters.'
,
array
(
'%name'
=>
"<em>
$name
</em>"
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment