diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-03 13:41:59 +0300 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-03 13:41:59 +0300 |
commit | e80eb79a1e59d74f35136e33407c98909474d3af (patch) | |
tree | 84bb1f16bf0813fd5235337936a1758346bcd656 /apps/user_ldap | |
parent | fb63484ced924097539e056e06945eaaada27ff7 (diff) |
Remove redundant is_array check
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/Group_LDAP.php | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php index f757a8b5e12..0f701f66b19 100644 --- a/apps/user_ldap/lib/Group_LDAP.php +++ b/apps/user_ldap/lib/Group_LDAP.php @@ -863,20 +863,18 @@ class Group_LDAP extends BackendUtility implements GroupInterface, IGroupLDAP, I $groups = $this->access->fetchListOfGroups($filter, [strtolower($this->access->connection->ldapGroupMemberAssocAttr), $this->access->connection->ldapGroupDisplayName, 'dn']); - if (is_array($groups)) { - $fetcher = function ($dn) use (&$seen) { - if (is_array($dn) && isset($dn['dn'][0])) { - $dn = $dn['dn'][0]; - } - return $this->getGroupsByMember($dn, $seen); - }; - - if (empty($dn)) { - $dn = ""; + $fetcher = function ($dn) use (&$seen) { + if (is_array($dn) && isset($dn['dn'][0])) { + $dn = $dn['dn'][0]; } + return $this->getGroupsByMember($dn, $seen); + }; - $allGroups = $this->walkNestedGroups($dn, $fetcher, $groups, $seen); + if (empty($dn)) { + $dn = ""; } + + $allGroups = $this->walkNestedGroups($dn, $fetcher, $groups, $seen); $visibleGroups = $this->filterValidGroups($allGroups); return array_intersect_key($allGroups, $visibleGroups); } |