Author: fabien
Date: 2010-05-19 15:12:27 +0200 (Wed, 19 May 2010)
New Revision: 29528

Modified:
   branches/1.3/lib/user/sfBasicSecurityUser.class.php
   branches/1.4/lib/user/sfBasicSecurityUser.class.php
Log:
[1.3, 1.4] fixed warning in sfBasicSecurityUser when hasCredentials is called 
before credentials are set (closes #8512)

Modified: branches/1.3/lib/user/sfBasicSecurityUser.class.php
===================================================================
--- branches/1.3/lib/user/sfBasicSecurityUser.class.php 2010-05-19 13:08:37 UTC 
(rev 29527)
+++ branches/1.3/lib/user/sfBasicSecurityUser.class.php 2010-05-19 13:12:27 UTC 
(rev 29528)
@@ -37,7 +37,6 @@
    */
   public function clearCredentials()
   {
-    $this->credentials = null;
     $this->credentials = array();
   }
 
@@ -141,6 +140,11 @@
    */
   public function hasCredential($credentials, $useAnd = true)
   {
+    if (null === $this->credentials)
+    {
+      return false;
+    }
+
     if (!is_array($credentials))
     {
       return in_array($credentials, $this->credentials);

Modified: branches/1.4/lib/user/sfBasicSecurityUser.class.php
===================================================================
--- branches/1.4/lib/user/sfBasicSecurityUser.class.php 2010-05-19 13:08:37 UTC 
(rev 29527)
+++ branches/1.4/lib/user/sfBasicSecurityUser.class.php 2010-05-19 13:12:27 UTC 
(rev 29528)
@@ -37,7 +37,6 @@
    */
   public function clearCredentials()
   {
-    $this->credentials = null;
     $this->credentials = array();
   }
 
@@ -133,6 +132,11 @@
    */
   public function hasCredential($credentials, $useAnd = true)
   {
+    if (null === $this->credentials)
+    {
+      return false;
+    }
+
     if (!is_array($credentials))
     {
       return in_array($credentials, $this->credentials);

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to