Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit b4c34af90a8ea35a510eebfb49fdf7baa8bf990d 1 parent 9b038ab
Morten Hundevad authored December 07, 2012

Showing 1 changed file with 18 additions and 18 deletions. Show diff stats Hide diff stats

  1. 36  libraries/joomla/user/user.php
36  libraries/joomla/user/user.php
@@ -546,24 +546,6 @@ public function bind(&$array)
546 546
 			// Set the registration timestamp
547 547
 
548 548
 			$this->set('registerDate', JFactory::getDate()->toSql());
549  
-
550  
-			// Check that username is not greater than 150 characters
551  
-			$username = $this->get('username');
552  
-
553  
-			if (strlen($username) > 150)
554  
-			{
555  
-				$username = substr($username, 0, 150);
556  
-				$this->set('username', $username);
557  
-			}
558  
-
559  
-			// Check that password is not greater than 100 characters
560  
-			$password = $this->get('password');
561  
-
562  
-			if (strlen($password) > 100)
563  
-			{
564  
-				$password = substr($password, 0, 100);
565  
-				$this->set('password', $password);
566  
-			}
567 549
 		}
568 550
 		else
569 551
 		{
@@ -615,6 +597,24 @@ public function bind(&$array)
615 597
 			return false;
616 598
 		}
617 599
 
  600
+        // Check that username is not greater than 150 characters
  601
+        $username = $this->get('username');
  602
+
  603
+        if (strlen($username) > 150)
  604
+        {
  605
+            $username = substr($username, 0, 150);
  606
+            $this->set('username', $username);
  607
+        }
  608
+
  609
+        // Check that password is not greater than 100 characters
  610
+        $password = $this->get('password');
  611
+
  612
+        if (strlen($password) > 100)
  613
+        {
  614
+            $password = substr($password, 0, 100);
  615
+            $this->set('password', $password);
  616
+        }
  617
+
618 618
 		// Make sure its an integer
619 619
 		$this->id = (int) $this->id;
620 620
 

0 notes on commit b4c34af

Please sign in to comment.
Something went wrong with that request. Please try again.