Modified:fixed username validation issue
This commit is contained in:
parent
283b1b354c
commit
65d3dcb33d
2 changed files with 30 additions and 20 deletions
|
@ -1576,6 +1576,9 @@
|
|||
if(!is_valid_syntax('username',$username) && $multi!='yes' || $matches) {
|
||||
e(lang("class_invalid_user"));
|
||||
}
|
||||
if(!preg_match('/^[A-Za-z0-9_.]+$/', $username)){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -241,6 +241,9 @@
|
|||
} else if (userSect.val().indexOf(' ') >= 0) {
|
||||
addErrClass(userSect, errors["username_spaces"], true, false);
|
||||
} else {
|
||||
if(!userSect.val().match(/^[A-Za-z0-9_.]+$/)){
|
||||
addErrClass(userSect, errors["name_invalid_chars"], true, false);
|
||||
}else{
|
||||
$.ajax({
|
||||
url: baseurl + "/ajax/commonAjax.php",
|
||||
type: "post",
|
||||
|
@ -263,6 +266,7 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('input#email').on('keyup change', function() {
|
||||
|
@ -372,6 +376,9 @@
|
|||
} else if (username.indexOf(' ') >= 0) {
|
||||
addErrClass(usernameSect, errors["username_spaces"]);
|
||||
goodToGo = false;
|
||||
} else if(!username.match(/^[A-Za-z0-9_.]+$/)){
|
||||
addErrClass(usernameSect, errors["name_invalid_chars"], true, false);
|
||||
goodToGo = false;
|
||||
}
|
||||
|
||||
/*if (gotNums != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue