From bb849003af1824db6f89d5df1409e3d5ffe3e527 Mon Sep 17 00:00:00 2001 From: Ermal Date: Thu, 30 Sep 2010 15:14:32 +0000 Subject: Initialize variable properly. Handle the case when the interfaces select box is disabled and it will not be posted(Reported-by: ghnb --- usr/local/www/system_gateways_edit.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index b9ea2fe..cc979a6 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -63,6 +63,7 @@ if (isset($_GET['dup'])) { } if (isset($id) && $a_gateways[$id]) { + $pconfig = array(); $pconfig['name'] = $a_gateways[$id]['name']; $pconfig['weight'] = $a_gateways[$id]['weight']; $pconfig['interface'] = $a_gateways[$id]['interface']; @@ -222,8 +223,6 @@ if ($_POST) { $gateway['descr'] = $_POST['descr']; if (is_ipaddr($_POST['monitor'])) $gateway['monitor'] = $_POST['monitor']; - else - unset($gateway['monitor']); if ($_POST['defaultgw'] == "yes" || $_POST['defaultgw'] == "on") { $i = 0; @@ -233,8 +232,7 @@ if ($_POST) { } $gateway['defaultgw'] = true; $reloadif = true; - } else - unset($gateway['defaultgw']); + } if ($_POST['latencylow']) $gateway['latencylow'] = $_POST['latencylow']; @@ -315,8 +313,15 @@ function show_advanced_gateway() { - \n"; + } else + echo "