Private GIT

Skip to content
Snippets Groups Projects
Commit 9176c54f authored by Kevin Duret's avatar Kevin Duret
Browse files

fix(clapi): retrieve clapi export header

export header was deleted, but api did not work anymore

Refs: #5541
parent 43ab55f1
Branches
No related tags found
No related merge requests found
......@@ -719,7 +719,7 @@ class CentreonAPI
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] . ";")));
......@@ -849,6 +849,7 @@ class CentreonAPI
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')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment