summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-11-06 12:31:03 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-11-06 12:31:03 -0400
commit6a93718873ca46605d228c024780ea86f43eb9b8 (patch)
tree0c1e1905c2a9b1d46e1316ad8de485abe18c2282 /usr
parent8625c24f8e8f8b63b6807b22d261062d02e3a396 (diff)
downloadpfsense-6a93718873ca46605d228c024780ea86f43eb9b8.zip
pfsense-6a93718873ca46605d228c024780ea86f43eb9b8.tar.gz
Ensure passed interface is valid
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/interfaces.php14
1 files changed, 14 insertions, 0 deletions
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";
}
OpenPOWER on IntegriCloud