Private GIT

Skip to content
Snippets Groups Projects
Commit a5495dfe authored by loiclau's avatar loiclau Committed by Matthieu Kermagoret
Browse files

fix(api rest) fix api

parent 79483e91
No related branches found
No related tags found
No related merge requests found
...@@ -411,7 +411,7 @@ class CentreonRealtimeServices extends CentreonRealtimeBase ...@@ -411,7 +411,7 @@ class CentreonRealtimeServices extends CentreonRealtimeBase
} }
if ($this->instance != -1 && !empty($this->instance)) { if ($this->instance != -1 && !empty($this->instance)) {
$query = " AND h.instance_id = " . $this->instance . " "; $query .= " AND h.instance_id = ? ";
$queryValues[] = (int)$this->instance; $queryValues[] = (int)$this->instance;
} }
......
...@@ -89,7 +89,7 @@ class CentreonRtDowntime extends CentreonObject ...@@ -89,7 +89,7 @@ class CentreonRtDowntime extends CentreonObject
* @return array * @return array
* @throws CentreonClapiException * @throws CentreonClapiException
*/ */
private function parseParameters($action, $parameters) private function parseParameters($parameters)
{ {
// Permet de sécuriser les inputs pour chaque paramètre // Permet de sécuriser les inputs pour chaque paramètre
list($type, $resource, $start, $end, $fixed, $duration, $withServices, $comment) = explode(';', $parameters); list($type, $resource, $start, $end, $fixed, $duration, $withServices, $comment) = explode(';', $parameters);
...@@ -316,7 +316,7 @@ class CentreonRtDowntime extends CentreonObject ...@@ -316,7 +316,7 @@ class CentreonRtDowntime extends CentreonObject
*/ */
public function add($parameters = null) public function add($parameters = null)
{ {
$parsedParameters = $this->parseParameters($this->action, $parameters); $parsedParameters = $this->parseParameters($parameters);
// Permet que $method prenne le bon nom de methode (addHostDowntime, addSvcDowntime etc.) // Permet que $method prenne le bon nom de methode (addHostDowntime, addSvcDowntime etc.)
$method = 'add' . ucfirst($parsedParameters['type']) . 'Downtime'; $method = 'add' . ucfirst($parsedParameters['type']) . 'Downtime';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment