Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(clapi): retrieve clapi export header
Browse files Browse the repository at this point in the history
export header was deleted, but api did not work anymore

Refs: #5541
  • Loading branch information
kduret committed Aug 24, 2017
1 parent 4ed123d commit 76041b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion www/class/centreon-clapi/centreonAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ public function import($filename)
while ($string = fgets($handle)) {
$i++;
$tab = preg_split('/;/', $string);
if (strlen(trim($string)) != 0) {
if (strlen(trim($string)) != 0 && !preg_match('/^\{OBJECT_TYPE\}/', $string)) {
$this->object = trim($tab[0]);
$this->action = trim($tab[1]);
$this->variables = trim(substr($string, strlen($tab[0] . ";" . $tab[1] . ";")));
Expand Down Expand Up @@ -819,6 +819,7 @@ public function export()
exit($this->return_code);
} else {
// header
echo "{OBJECT_TYPE}{$this->delim}{COMMAND}{$this->delim}{PARAMETERS}\n";
if (count($this->aExport) > 0) {
foreach ($this->aExport as $oObjet) {
if (method_exists($this->objectTable[$oObjet], 'export')) {
Expand Down

0 comments on commit 76041b0

Please sign in to comment.