From 41479a3dfb77ff88bfba5b015266ce03532e3307 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 16 Nov 2015 07:47:35 +0100 Subject: [PATCH] console: fix access test of gateways array --- src/etc/rc.initial.setlanip | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/etc/rc.initial.setlanip b/src/etc/rc.initial.setlanip index c05bfb3c3..2e6db97ce 100755 --- a/src/etc/rc.initial.setlanip +++ b/src/etc/rc.initial.setlanip @@ -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'];