summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_ldap_generic.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-09-26 11:44:54 +0200
committerAleksander Machniak <alec@alec.pl>2013-09-26 11:44:54 +0200
commita4bc6ea24d476e88a6d231ef3162d7271fe22bbd (patch)
tree34c200bb2b7ad7385e1f1e08bfd0ab5108fe8b7a /program/lib/Roundcube/rcube_ldap_generic.php
parent955a613cace064eb8a4579680ad0e971f2881ac4 (diff)
Handle nicely situation when normalize_entry is executed on already normalized entry
Diffstat (limited to 'program/lib/Roundcube/rcube_ldap_generic.php')
-rw-r--r--program/lib/Roundcube/rcube_ldap_generic.php6
1 files changed, 6 insertions, 0 deletions
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) {