diff options
Diffstat (limited to 'Core/Functions/func_register.php')
| -rw-r--r-- | Core/Functions/func_register.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Core/Functions/func_register.php b/Core/Functions/func_register.php index d8960ce..1a94bc1 100644 --- a/Core/Functions/func_register.php +++ b/Core/Functions/func_register.php @@ -8,14 +8,16 @@ function register($email, $password, $userStatus) { // les regex necessaire pour vérifier le mot de passe - $numb = "/[0-9]/"; - $upper = "/[A-Z]/"; - $special = "/[`!@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?~µ°€£]/"; + $regNumb = "/[0-9]/"; + $regUpper = "/[A-Z]/"; + $regSpecial = "/[`!@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?~µ°€£]/"; + $regEmail = "/^[a-z0-9_-]+@[a-z0-9-]+\.[a-z]/"; if ((strlen($password) >= 8) - && preg_match($numb, $password) - && preg_match($upper, $password) - && preg_match($special, $password) + && preg_match($regNumb, $password) + && preg_match($regUpper, $password) + && preg_match($regSpecial, $password) + && preg_match($regEmail, $email) ) { $dbuser = new DbUser; |
