Commit 5b45c4af authored by Dries's avatar Dries

- Patch #146313 by walkah: _user_edit_validate assumes arg(1) == 'register'...

- Patch #146313 by walkah: _user_edit_validate assumes arg(1) == 'register' when being called for the user_register form
parent 3cafffe6
......@@ -1509,7 +1509,7 @@ function user_edit_form($uid, $edit, $register = FALSE) {
function _user_edit_validate($uid, &$edit) {
$user = user_load(array('uid' => $uid));
// Validate the username:
if (user_access('change own username') || user_access('administer users') || arg(1) == 'register') {
if (user_access('change own username') || user_access('administer users') || !$user->uid) {
if ($error = user_validate_name($edit['name'])) {
form_set_error('name', $error);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment