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

Commit

Permalink
Fix issue #3824 PHP Warning: array_map(): Argument #2 should be an array
Browse files Browse the repository at this point in the history
  • Loading branch information
Toufik MECHOUET committed Oct 26, 2015
1 parent 028f3e3 commit 7473fbe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions www/class/centreonHost.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,11 @@ public function getTemplates($hostId = null) {
$i++;
}
} else {
foreach ($_REQUEST['tpSelect'] as $val) {
$arr[$i]['tpSelect_#index#'] = $val;
$i++;
if (isset($_REQUEST['tpSelect'])) {
foreach ($_REQUEST['tpSelect'] as $val) {
$arr[$i]['tpSelect_#index#'] = $val;
$i++;
}
}
}
return $arr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#
$host = array();
if (($o == "c" || $o == "w") && $host_id) {
$DBRESULT = $pearDB->query("SELECT * FROM host, extended_host_information ehi WHERE host_id = '".$host_id."' AND ehi.host_host_id = host.host_id LIMIT 1");
$DBRESULT = $pearDB->query("SELECT * FROM host LEFT JOIN extended_host_information ehi ON ehi.host_host_id = host.host_id WHERE host_id = '".$host_id."' LIMIT 1");

# Set base value
if ($DBRESULT->numRows()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function myDecodeService($arg) {
$initialValues = array();
if (($o == "c" || $o == "w") && $service_id) {

$DBRESULT = $pearDB->query("SELECT * FROM service, extended_service_information esi WHERE service_id = '".$service_id."' AND esi.service_service_id = service_id LIMIT 1");
$DBRESULT = $pearDB->query("SELECT * FROM service LEFT JOIN extended_service_information esi ON esi.service_service_id = service_id WHERE service_id = '".$service_id."' LIMIT 1");
/*
* Set base value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function myDecodeSvTP($arg) {
if (isset($lockedElements[$service_id])) {
$o = "w";
}
$DBRESULT = $pearDB->query("SELECT * FROM service, extended_service_information esi WHERE service_id = '".$service_id."' AND esi.service_service_id = service_id LIMIT 1");
$DBRESULT = $pearDB->query("SELECT * FROM service LEFT JOIN extended_service_information esi ON esi.service_service_id = service_id WHERE service_id = '".$service_id."' LIMIT 1");
// Set base value
$service_list = $DBRESULT->fetchRow();
$service = array_map("myDecodeSvTP", $service_list);
Expand Down

0 comments on commit 7473fbe

Please sign in to comment.