Create function to validate usernames (by regex)
This commit is contained in:
parent
88db2c2919
commit
2b5c2fdc5c
|
@ -73,3 +73,8 @@ function if_session_redirect_app() {
|
|||
if (session() !== null)
|
||||
redirect(APP_DIR);
|
||||
}
|
||||
|
||||
|
||||
function validate_username($username) {
|
||||
return preg_match('/^[a-zA-Z0-9\_]+$/', $username);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue