Aleksander Machniak
2013-09-26 a4bc6ea24d476e88a6d231ef3162d7271fe22bbd
Handle nicely situation when normalize_entry is executed on already normalized entry
1 files modified
6 ■■■■■ changed files
program/lib/Roundcube/rcube_ldap_generic.php 6 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_ldap_generic.php
@@ -696,11 +696,17 @@
     * 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) {