From 21cc180730b3a82dbd2b758d9f785f8105dc8ace Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 6 Jan 2015 04:09:36 -0500 Subject: Fix regression in searching for user's OU in select_options_ou() (#4164) There was also a PHP warning: "array_map(): Argument #2 should be an array..." --- lib/kolab_utils.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/kolab_utils.php') 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; } -- cgit v1.1