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

Commit

Permalink
fix(chart): Re allow to use wildcard in curve definition (#8194)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinsivy authored and sc979 committed Jan 2, 2020
1 parent 0c6227d commit 305519a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions www/class/centreonGraph.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,9 @@ public function initCurveList()
}
$ds_data_associated = null;
$ds_data_regular = null;
foreach ($components_ds_cache as $ds_val) {
foreach ($components_ds_cache as $dsVal) {
/* Prepare pattern for metrics */
$metricPattern = '/^' . preg_quote($ds_val['ds_name'], '/') . '$/i';
$metricPattern = '/^' . str_replace('/', '\/', $dsVal['ds_name']).'$/i';
$metricPattern = str_replace('\\*', '.*', $metricPattern);

# Check associated
Expand Down
4 changes: 2 additions & 2 deletions www/class/centreonGraphNg.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ protected function getCurveDsConfig($metric)
$dsDataAssociated = null;
$dsDataRegular = null;
foreach ($this->componentsDsCache as $dsVal) {
$metricPattern = '/^' . preg_quote($dsVal['ds_name'], '/') . '$/i';
$metricPattern = '/^' . str_replace('/', '\/', $dsVal['ds_name']).'$/i';
$metricPattern = str_replace('*', '.*', $metricPattern);

if (isset($metric['host_id']) && isset($metric['service_id']) &&
Expand Down Expand Up @@ -1147,7 +1147,7 @@ public function getOVDColor($indexId, $metricId)
$stmt->bindParam(':index_id', $indexId, PDO::PARAM_INT);
$stmt->bindParam(':metric_id', $metricId, PDO::PARAM_INT);
$stmt->execute();
return $l_rndcolor;
return $lRndcolor;
}

/**
Expand Down

0 comments on commit 305519a

Please sign in to comment.