diff options
Diffstat (limited to 'lib/kolab_utils.php')
-rw-r--r-- | lib/kolab_utils.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/kolab_utils.php b/lib/kolab_utils.php index 91dad55..822c2f4 100644 --- a/lib/kolab_utils.php +++ b/lib/kolab_utils.php @@ -171,16 +171,16 @@ class kolab_utils * * @param string $dn LDAP DN string * - * @return array Exploded DN (uses unicode encoding) + * @return array|bool Exploded DN (uses unicode encoding), False on failure */ public static function explode_dn($dn) { - $result = ldap_explode_dn($dn, 0); + if ($result = ldap_explode_dn($dn, 0)) { + // get rid of count + unset($result['count']); - // get rid of count - unset($result['count']); - - $result = array_map(array('kolab_utils', 'decode_dn'), $result); + $result = array_map(array('kolab_utils', 'decode_dn'), $result); + } return $result; } |