diff options
author | Renato Botelho <renato@netgate.com> | 2015-07-15 10:18:24 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-07-15 10:18:24 -0300 |
commit | fe05aacf24ce5e3aab009c0cc0545d6c532ad593 (patch) | |
tree | 77095d1c0e52be1aa8c54459b58dfa3ed3c86835 /usr | |
parent | 5e3999791f659421e38c0a23811748d404914914 (diff) | |
parent | ec4112ddcfdfe34c74afc28d2ebc037086ddad6a (diff) | |
download | pfsense-fe05aacf24ce5e3aab009c0cc0545d6c532ad593.zip pfsense-fe05aacf24ce5e3aab009c0cc0545d6c532ad593.tar.gz |
Merge pull request #1747 from phil-davis/patch-8
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/interfaces_ppps_edit.php | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php index c5c6c63..44d44a0 100644 --- a/usr/local/www/interfaces_ppps_edit.php +++ b/usr/local/www/interfaces_ppps_edit.php @@ -270,21 +270,23 @@ if ($_POST) { } } - foreach ($_POST['interfaces'] as $iface) { - if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) { - $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."), $iface); - } - if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) { - $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."), $iface); - } - if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) { - $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."), $iface); - } - if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) { - $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."), $iface); - } - if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) { - $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."), $iface); + if (is_array($_POST['interfaces'])) { + foreach ($_POST['interfaces'] as $iface) { + if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) { + $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."), $iface); + } + if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) { + $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."), $iface); + } + if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) { + $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."), $iface); + } + if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) { + $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."), $iface); + } + if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) { + $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."), $iface); + } } } |