summaryrefslogtreecommitdiffstats
path: root/lib/kolab_utils.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2015-01-06 04:09:36 -0500
committerAleksander Machniak <machniak@kolabsys.com>2015-01-06 04:09:36 -0500
commit21cc180730b3a82dbd2b758d9f785f8105dc8ace (patch)
tree972ff083b2b89182a3cb604eeb016ce1d6d983bc /lib/kolab_utils.php
parent9f5c1783654268d573888ab99578324d137871b0 (diff)
downloadwebadmin-21cc180730b3a82dbd2b758d9f785f8105dc8ace.tar.gz
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..."
Diffstat (limited to 'lib/kolab_utils.php')
-rw-r--r--lib/kolab_utils.php12
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;
}