Do not compare uids when reading data. Encoded values will be
authorGunnar Wrobel <p@rdus.de>
Mon, 13 Apr 2009 07:52:27 +0000 (09:52 +0200)
committerGunnar Wrobel <p@rdus.de>
Mon, 13 Apr 2009 07:55:43 +0000 (09:55 +0200)
difficult and the check for an empty result should be enough.

Corrected check for empty values.

framework/Kolab_Server/lib/Horde/Kolab/Server/Ldap.php

index 81587a1..a2645d3 100644 (file)
@@ -156,16 +156,7 @@ class Horde_Kolab_Server_Ldap extends Horde_Kolab_Server
                                                    Horde_Kolab_Server_Exception::EMPTY_RESULT);
         }            
 
-        if (!isset($data[$uid])) {
-            throw new Horde_Kolab_Server_Exception(sprintf(_("No result found for %s"),
-                                                           $uid),
-                                                   Horde_Kolab_Server_Exception::EMPTY_RESULT);
-        }
-        if (is_a($data[$uid], 'PEAR_Error')) {
-            throw new Horde_Kolab_Server_Exception($data[$uid],
-                                                   Horde_Kolab_Server_Exception::SYSTEM);
-        }
-        return $data[$uid];
+        return array_pop($data);
     }
 
     /**
@@ -194,7 +185,7 @@ class Horde_Kolab_Server_Ldap extends Horde_Kolab_Server
                     $values = array($values);
                 }
                 foreach ($values as $value) {
-                    if (!empty($value)) {
+                    if (!($value === null || $info[$key] === '')) {
                         $empty = false;
                         break;
                     }