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

Commit

Permalink
Fix: Remove obsolete code in legacy service detail page (#11848) (#11879
Browse files Browse the repository at this point in the history
)

* Remove obsolete code in legacy service detail page

* restore deleted code

* remove obsolete code in legacy service detail page and query sanitizeÃ
  • Loading branch information
emabassi-ext authored Sep 28, 2022
1 parent b000506 commit 8873347
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions www/include/monitoring/objectDetails/serviceDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,18 +621,17 @@
$status .= "&value[" . $key . "]=" . $value;
}

$optionsURL = "host_name=" . urlencode($host_name) . "&service_description=" . urlencode($svc_description);

$query = "SELECT id FROM `index_data`, `metrics` WHERE host_name = '" . $pearDBO->escape($host_name) .
"' AND service_description = '" . $pearDBO->escape($svc_description) . "' AND id = index_id LIMIT 1";
$DBRES = $pearDBO->query($query);
$query = "SELECT id FROM `index_data`, `metrics` WHERE host_name = :host_name" .
" AND service_description = :svc_description AND id = index_id LIMIT 1";
$statement = $pearDBO->prepare($query);
$statement->bindValue(':host_name', $host_name, \PDO::PARAM_STR);
$statement->bindValue(':svc_description', $svc_description, \PDO::PARAM_STR);
$statement->execute();
$index_data = 0;
if ($DBRES->rowCount()) {
$row = $DBRES->fetchRow();
if ($statement->rowCount()) {
$row = $statement->fetchRow();
$index_data = $row['id'];
}
$optionsURL2 = "index=" . $index_data;

/*
* Assign translations
*/
Expand Down Expand Up @@ -875,9 +874,7 @@
$tpl->assign("sv_ext_action_url_lang", _("Action URL"));
$tpl->assign("sv_ext_action_url", CentreonUtils::escapeSecure($actionurl));
$tpl->assign("sv_ext_icon_image_alt", getMyServiceExtendedInfoField($service_id, "esi_icon_image_alt"));
$tpl->assign("options", $optionsURL);
$tpl->assign("index_data", $index_data);
$tpl->assign("options2", CentreonUtils::escapeSecure($optionsURL2));

/**
* Build the service detail URI that will be used in the
Expand Down

0 comments on commit 8873347

Please sign in to comment.