From 209313da2033fd51111f5fc012926e8e3a571a58 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 5 May 2011 14:39:50 +0000 Subject: [PATCH] more isset() from stintel git-svn-id: http://www.observium.org/svn/observer/trunk@2251 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/functions.inc.php | 4 ++-- html/index.php | 2 +- includes/common.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index ad4df7734f..66bfe70a05 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -26,7 +26,7 @@ function generate_device_link($device, $text=0, $linksuffix="", $start=0, $end=0 { $graphs = $config['os'][$device['os']]['over']; } - elseif (isset($config['os'][$device['os_group']]['over'])) + elseif (isset($device['os_group']) && isset($config['os'][$device['os_group']]['over'])) { $graphs = $config['os'][$device['os_group']]['over']; } @@ -244,7 +244,7 @@ function generate_port_link($args, $text = NULL, $type = NULL) $args = ifNameDescr($args); if (!$text) { $text = fixIfName($args['label']); } if ($type) { $args['graph_type'] = $type; } - if (!$args['graph_type']) { $args['graph_type'] = 'port_bits'; } + if (!isset($args['graph_type'])) { $args['graph_type'] = 'port_bits'; } $class = ifclass($args['ifOperStatus'], $args['ifAdminStatus']); if (!isset($args['hostname'])) { $args = array_merge($args, device_by_id_cache($args['device_id'])); } diff --git a/html/index.php b/html/index.php index 5cd4290810..57f2bcec71 100755 --- a/html/index.php +++ b/html/index.php @@ -33,7 +33,7 @@ $month = time() - (31 * 24 * 60 * 60); $year = time() - (365 * 24 * 60 * 60); # Load the settings for Multi-Tenancy. -if (is_array($config['branding'])) +if (isset($config['branding']) && is_array($config['branding'])) { if ($config['branding'][$_SERVER['SERVER_NAME']]) { diff --git a/includes/common.php b/includes/common.php index 2dc3d42bba..649cad1066 100644 --- a/includes/common.php +++ b/includes/common.php @@ -100,7 +100,7 @@ function device_by_id_cache($device_id) { global $device_cache; - if (is_array($device_cache[$device_id])) + if (isset($device_cache[$device_id]) && is_array($device_cache[$device_id])) { $device = $device_cache[$device_id]; } else {