From 6a93718873ca46605d228c024780ea86f43eb9b8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 6 Nov 2010 12:31:03 -0400 Subject: Ensure passed interface is valid --- usr/local/www/interfaces.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'usr/local/www/interfaces.php') diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index f08ca3c..218e6bf 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -54,8 +54,22 @@ require_once("rrd.inc"); require_once("vpn.inc"); require_once("xmlparse_attr.inc"); +$ifdescrs = array('wan' => gettext('WAN'), 'lan' => gettext('LAN')); +for($j = 1; isset($config['interfaces']['opt' . $j]); $j++) { + if(isset($config['interfaces']['opt' . $j]['enable'])) + $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr']; +} + if ($_REQUEST['if']) { $if = $_REQUEST['if']; + $found = false; + foreach($ifdescrs as $descr => $ifdescr) + if($descr == $if) + $found = true; + if(!$found) { + Header("Location: interfaces.php"); + exit; + } } else { $if = "wan"; } -- cgit v1.1