From 0d46280907caf476f20ee017456f340d8f226063 Mon Sep 17 00:00:00 2001
From: Vittal Aithal <v@aithal.org>
Date: Sun, 14 Jan 2018 21:55:56 +0000
Subject: [PATCH] Prevent an assert by only calling a sub-search if needed

---
 modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php b/modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php
index c263db0e6..6453db2aa 100644
--- a/modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php
+++ b/modules/ldap/lib/Auth/Process/AttributeAddUsersGroups.php
@@ -263,7 +263,9 @@ class sspmod_ldap_Auth_Process_AttributeAddUsersGroups extends sspmod_ldap_Auth_
             $groups[] = $dn;
 
             // Recursively search "sub" groups
-            $groups = array_merge($groups, $this->search($attributes[$map['memberof']]));
+            if (is_array($attributes[$map['memberof']])) {
+                $groups = array_merge($groups, $this->search($attributes[$map['memberof']]));
+            }
         }
 
         // Return only the unique group names
-- 
GitLab