summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@gmail.com>2011-11-16 10:42:30 -0500
committerScott Ullrich <sullrich@gmail.com>2011-11-16 10:42:30 -0500
commit9870b4a22a5f24f6de53688cbf87b127acce87f2 (patch)
tree6cfe114e0ac6d7b7dfffda10489c2867f78dceae
parent6daf497bb2f97a6da719c3e5b157f71521b85dda (diff)
downloadpfsense-9870b4a22a5f24f6de53688cbf87b127acce87f2.zip
pfsense-9870b4a22a5f24f6de53688cbf87b127acce87f2.tar.gz
Ensure style is set to a valid item
-rwxr-xr-xusr/local/www/status_rrd_graph.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index 93c4dfd..357db46 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -156,9 +156,17 @@ if($end < $start) {
}
$seconds = $end - $start;
-
+
+$styles = array('inverse' => gettext('Inverse'),
+ 'absolute' => gettext('Absolute'));
+
+// Set default and override later
+$curstyle = "inverse";
+
if ($_GET['style']) {
- $curstyle = $_GET['style'];
+ foreach($styles as $style)
+ if($style == $_GET['style'])
+ $curstyle = $_GET['style'];
} else {
if(! empty($config['rrd']['style'])) {
$curstyle = $config['rrd']['style'];
@@ -208,8 +216,6 @@ foreach($databases as $database) {
$ui_databases = array_merge($dbheader, $databases);
$custom_databases = array_merge($dbheader_custom, $databases);
-$styles = array('inverse' => gettext('Inverse'),
- 'absolute' => gettext('Absolute'));
$graphs = array("8hour", "day", "week", "month", "quarter", "year", "4year");
$periods = array("absolute" => gettext("Absolute Timespans"), "current" => gettext("Current Period"), "previous" => gettext("Previous Period"));
$graph_length = array(
OpenPOWER on IntegriCloud