diff --git a/www/class/centreon-clapi/centreonCentbrokerCfg.class.php b/www/class/centreon-clapi/centreonCentbrokerCfg.class.php index 0f8982dc205a63edb019a144b325434d5b9f0e9d..7558992cf26471e6ae658db582c5c512d7b647e1 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); }