LSldapObject : fix foreach error in getObjectKeyValueInRelation() if attribute is... master
authorBenjamin Renard <brenard@easter-eggs.com>
Fri, 18 Aug 2017 09:59:12 +0000 (11:59 +0200)
committerBenjamin Renard <brenard@easter-eggs.com>
Fri, 18 Aug 2017 09:59:12 +0000 (11:59 +0200)
public_html/includes/class/class.LSldapObject.php

index c2e5e14..79efc56 100644 (file)
@@ -1327,8 +1327,11 @@ class LSldapObject {
           $keyValues[] = $dn;
       }
       else {
-        foreach ($object -> getValue($attrValue) as $keyValue)
-          if (!in_array($keyValue,$keyValues)) $keyValues[]=$keyValue;
+        $values=$object -> getValue($attrValue);
+        if (is_array($values))
+          foreach ($values as $keyValue)
+            if (!in_array($keyValue,$keyValues))
+              $keyValues[]=$keyValue;
       }
     }
     return $keyValues;