From 92b17aeda55876f65318c7067aebbb4663fb01fa Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 14 Aug 2005 17:46:26 +0000 Subject: Make sure gateway is a valid ip address Ticket #348 --- usr/local/www/interfaces_opt.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'usr/local/www/interfaces_opt.php') diff --git a/usr/local/www/interfaces_opt.php b/usr/local/www/interfaces_opt.php index e9ee4d0..0189fa4 100755 --- a/usr/local/www/interfaces_opt.php +++ b/usr/local/www/interfaces_opt.php @@ -135,6 +135,10 @@ if ($_POST) { if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) { $input_errors[] = "A valid subnet bit count must be specified."; } + + if($_POST['gateway'] <> "" && !is_ipaddr($_POST['gateway'])) { + $input_errors[] = "A valid gateway must be specified."; + } } if ($_POST['mtu'] && (($_POST['mtu'] < 576) || ($_POST['mtu'] > 1500))) { $input_errors[] = "The MTU must be between 576 and 1500 bytes."; -- cgit v1.1