Code Duplication    Length = 3-3 lines in 2 locations

classes/GuestReg.php 1 location

@@ 49-51 (lines=3) @@
46
            $this->errors[] = "Password and password repeat are not the same";
47
        } elseif (strlen($_POST['user_password_new']) < 6) {
48
            $this->errors[] = "Password has a minimum length of 6 characters";
49
        } elseif (strlen($_POST['user_name']) > 64 || strlen($_POST['user_name']) < 2) {
50
            $this->errors[] = "Username cannot be shorter than 2 or longer than 30 characters";
51
        } elseif (!preg_match('/^[a-z\d]{2,30}$/i', $_POST['user_name'])) {
52
            $this->errors[] = "Username does not fit the name scheme: only a-Z and numbers are allowed, 2 to 64 characters";
53
        } elseif (empty($_POST['user_email'])) {
54
            $this->errors[] = "Email cannot be empty";

classes/registration.php 1 location

@@ 49-51 (lines=3) @@
46
            $this->errors[] = "Password and password repeat are not the same";
47
        } elseif (strlen($_POST['user_password_new']) < 6) {
48
            $this->errors[] = "Password has a minimum length of 6 characters";
49
        } elseif (strlen($_POST['user_name']) > 64 || strlen($_POST['user_name']) < 2) {
50
            $this->errors[] = "Username cannot be shorter than 2 or longer than 30 characters";
51
        } elseif (!preg_match('/^[a-z\d]{2,30}$/i', $_POST['user_name'])) {
52
            $this->errors[] = "Username does not fit the name scheme: only a-Z and numbers are allowed, 2 to 64 characters";
53
        } elseif (empty($_POST['user_email'])) {
54
            $this->errors[] = "Email cannot be empty";