console: fix access test of gateways array

This commit is contained in:
Franco Fichtner 2015-11-16 07:47:35 +01:00
parent 1a9e8c9694
commit 41479a3dfb

View File

@ -196,7 +196,7 @@ function next_unused_gateway_name($interface)
global $g, $config;
$new_name = "GW_" . strtoupper($interface);
if (!is_array($config['gateways']['gateway_item'])) {
if (!isset($config['gateways']['gateway_item'])) {
return $new_name;
}
$count = 1;
@ -219,7 +219,8 @@ function next_unused_gateway_name($interface)
function add_gateway_to_config($interface, $gatewayip, $inet_type)
{
global $g, $config, $dry_run;
if (!is_array($config['gateways']['gateway_item'])) {
if (!isset($config['gateways']['gateway_item'])) {
$config['gateways']['gateway_item'] = array();
}
$a_gateways = &$config['gateways']['gateway_item'];