Create function to validate usernames (by regex)

This commit is contained in:
Niko 2022-02-11 01:26:33 +01:00
parent 88db2c2919
commit 2b5c2fdc5c
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}