diff options
author | Phil Davis <phil.davis@inf.org> | 2015-07-12 11:34:17 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-07-12 11:34:17 +0545 |
commit | 9a01d22d4fb39e29fbda87f7980045603222a36a (patch) | |
tree | a6fe8b3bda28f37a2e0986a6c5b0dec5a9251306 /usr/local/www/system_routes_edit.php | |
parent | 028ff8f8a3d7c09ee5604d6f3eadcdaaef1610c7 (diff) | |
download | pfsense-9a01d22d4fb39e29fbda87f7980045603222a36a.zip pfsense-9a01d22d4fb39e29fbda87f7980045603222a36a.tar.gz |
Static routes merge "else" and "if" into "else if"
As suggested by Renato.
Diffstat (limited to 'usr/local/www/system_routes_edit.php')
-rw-r--r-- | usr/local/www/system_routes_edit.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index ea9047f..5d57622 100644 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -102,14 +102,12 @@ if ($_POST) { if (($_POST['gateway']) && is_ipaddr($_POST['network'])) { if (!isset($a_gateways[$_POST['gateway']])) { $input_errors[] = gettext("A valid gateway must be specified."); + } else if (isset($a_gateways[$_POST['gateway']]['disabled']) && !$_POST['disabled']) { + $input_errors[] = gettext("The gateway is disabled but the route is not. You must disable the route in order to choose a disabled gateway."); } else { - if (isset($a_gateways[$_POST['gateway']]['disabled']) && !$_POST['disabled']) { - $input_errors[] = gettext("The gateway is disabled but the route is not. You must disable the route in order to choose a disabled gateway."); - } else { - // Note that the 3rd parameter "disabled" must be passed as explicitly true or false. - if (!validate_address_family($_POST['network'], $_POST['gateway'], $_POST['disabled'] ? true : false)) { - $input_errors[] = gettext("The gateway '{$a_gateways[$_POST['gateway']]['gateway']}' is a different Address Family than network '{$_POST['network']}'."); - } + // Note that the 3rd parameter "disabled" must be passed as explicitly true or false. + if (!validate_address_family($_POST['network'], $_POST['gateway'], $_POST['disabled'] ? true : false)) { + $input_errors[] = gettext("The gateway '{$a_gateways[$_POST['gateway']]['gateway']}' is a different Address Family than network '{$_POST['network']}'."); } } } |