From 1322da08c4bbd24cdf843b828b546621c617f2db Mon Sep 17 00:00:00 2001
From: Kevin Duret <duret.kevin@gmail.com>
Date: Wed, 28 Feb 2018 10:24:37 +0100
Subject: [PATCH] fix(clapi): fix array init in broker configuration object
 (#6097)

---
 www/class/centreon-clapi/centreonCentbrokerCfg.class.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/www/class/centreon-clapi/centreonCentbrokerCfg.class.php b/www/class/centreon-clapi/centreonCentbrokerCfg.class.php
index 0f8982dc20..7558992cf2 100644
--- a/www/class/centreon-clapi/centreonCentbrokerCfg.class.php
+++ b/www/class/centreon-clapi/centreonCentbrokerCfg.class.php
@@ -404,10 +404,12 @@ class CentreonCentbrokerCfg extends CentreonObject
             "AND config_key = 'name' " .
             "AND config_group = ? ";
         $res = $this->db->query($sql, array($configId, $tagName));
-        $listName[] = array();
+
+        $listName = array();
         while ($list = $res->fetch()) {
             $listName[] = $list['config_value'];
         }
+
         if (in_array($args[1], $listName)) {
             throw new CentreonClapiException(self::OBJECTALREADYEXISTS);
         }
-- 
GitLab