summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/controllers/user.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/application/controllers/user.php b/application/controllers/user.php
index aa1ea235b..cac47ebe1 100644
--- a/application/controllers/user.php
+++ b/application/controllers/user.php
@@ -142,6 +142,10 @@ class User extends CI_Controller {
if (!$username || strlen($username) > 32 || !preg_match("/^[a-z0-9]+$/", $username)) {
$error[]= "Invalid username (only up to 32 chars of a-z0-9 are allowed).";
+ } else {
+ if ($this->muser->username_exists($username)) {
+ $error[] = "Username already exists.";
+ }
}
$this->load->helper("email");
@@ -149,10 +153,6 @@ class User extends CI_Controller {
$error[]= "Invalid email.";
}
- if ($this->muser->username_exists($username)) {
- $error[] = "Username already exists.";
- }
-
if (!$password || $password != $password_confirm) {
$error[]= "No password or passwords don't match.";
}