more isset() from stintel

git-svn-id: http://www.observium.org/svn/observer/trunk@2251 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-05 14:39:50 +00:00
parent bd56d2e3fe
commit 209313da20
3 changed files with 4 additions and 4 deletions

View File

@ -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'])); }

View File

@ -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']])
{

View File

@ -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 {