From a4bc6ea24d476e88a6d231ef3162d7271fe22bbd Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 26 Sep 2013 11:44:54 +0200 Subject: Handle nicely situation when normalize_entry is executed on already normalized entry --- program/lib/Roundcube/rcube_ldap_generic.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'program/lib/Roundcube/rcube_ldap_generic.php') diff --git a/program/lib/Roundcube/rcube_ldap_generic.php b/program/lib/Roundcube/rcube_ldap_generic.php index 88378dc22..923a12a41 100644 --- a/program/lib/Roundcube/rcube_ldap_generic.php +++ b/program/lib/Roundcube/rcube_ldap_generic.php @@ -696,11 +696,17 @@ class rcube_ldap_generic * Turn an LDAP entry into a regular PHP array with attributes as keys. * * @param array $entry Attributes array as retrieved from ldap_get_attributes() or ldap_get_entries() + * * @return array Hash array with attributes as keys */ public static function normalize_entry($entry) { + if (!isset($entry['count'])) { + return $entry; + } + $rec = array(); + for ($i=0; $i < $entry['count']; $i++) { $attr = $entry[$i]; if ($entry[$attr]['count'] == 1) { -- cgit v1.2.3