From 7e28f339da60e09b65478ac918113316c21b38f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be>
Date: Wed, 27 Jun 2018 11:59:31 +0200
Subject: [PATCH] :ambulance: fix(core) ... operator cannot be used on
 associative arrays
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It’s a bit less readable but we have to call array_values to avoid a
 fatal error.

issue #5827
---
 include/class_template.inc                 | 2 +-
 include/class_templateHandling.inc         | 2 +-
 plugins/admin/groups/class_roleGeneric.inc | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/class_template.inc b/include/class_template.inc
index 58517ba1c..afa92cad1 100644
--- a/include/class_template.inc
+++ b/include/class_template.inc
@@ -276,7 +276,7 @@ class template
       $specialAttrs['caller'.strtoupper($attr)] = $ui->$attr;
     }
     $this->attrs = templateHandling::parseArray($this->attrs, $specialAttrs);
-    $this->tabObject->adapt_from_template($this->attrs, array_merge(...$this->attributes));
+    $this->tabObject->adapt_from_template($this->attrs, array_merge(...array_values($this->attributes)));
 
     $this->applied = TRUE;
     return $this->tabObject;
diff --git a/include/class_templateHandling.inc b/include/class_templateHandling.inc
index 88e28157b..1bffdc7f5 100644
--- a/include/class_templateHandling.inc
+++ b/include/class_templateHandling.inc
@@ -176,7 +176,7 @@ class templateHandling
         unset($attrs[$attr]);
       }
     }
-    $dependencies = array_unique(array_merge(...$flatdepends));
+    $dependencies = array_unique(array_merge(...array_values($flatdepends)));
     foreach ($dependencies as $attr) {
       if (empty($flatdepends[$attr])) {
         $needed[] = $attr;
diff --git a/plugins/admin/groups/class_roleGeneric.inc b/plugins/admin/groups/class_roleGeneric.inc
index 7d16dcb54..10826f81e 100644
--- a/plugins/admin/groups/class_roleGeneric.inc
+++ b/plugins/admin/groups/class_roleGeneric.inc
@@ -32,7 +32,7 @@ class RoleMembersAttribute extends UsersAttribute
         if (empty($groups)) {
           $this->whitelistDns = array();
         } else {
-          $this->whitelistDns = array_merge_recursive(...$groups)['member'];
+          $this->whitelistDns = array_merge_recursive(...array_values($groups))['member'];
         }
       }
       return array(
-- 
GitLab