Permalink
Browse files

Fixed issue with the password and username check is not preformed for…

… new users because the values are not yet set, Fixed by moving the check below setProperties
  • Loading branch information...
1 parent 9b038ab commit b4c34af90a8ea35a510eebfb49fdf7baa8bf990d @fanno committed Dec 7, 2012
Showing with 18 additions and 18 deletions.
  1. +18 −18 libraries/joomla/user/user.php
@@ -546,24 +546,6 @@ public function bind(&$array)
// Set the registration timestamp
$this->set('registerDate', JFactory::getDate()->toSql());
-
- // Check that username is not greater than 150 characters
- $username = $this->get('username');
-
- if (strlen($username) > 150)
- {
- $username = substr($username, 0, 150);
- $this->set('username', $username);
- }
-
- // Check that password is not greater than 100 characters
- $password = $this->get('password');
-
- if (strlen($password) > 100)
- {
- $password = substr($password, 0, 100);
- $this->set('password', $password);
- }
}
else
{
@@ -615,6 +597,24 @@ public function bind(&$array)
return false;
}
+ // Check that username is not greater than 150 characters
+ $username = $this->get('username');
+
+ if (strlen($username) > 150)
+ {
+ $username = substr($username, 0, 150);
+ $this->set('username', $username);
+ }
+
+ // Check that password is not greater than 100 characters
+ $password = $this->get('password');
+
+ if (strlen($password) > 100)
+ {
+ $password = substr($password, 0, 100);
+ $this->set('password', $password);
+ }
+
// Make sure its an integer
$this->id = (int) $this->id;

0 comments on commit b4c34af

Please sign in to comment.