diff options
author | Scott Ullrich <sullrich@gmail.com> | 2011-11-16 10:41:39 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@gmail.com> | 2011-11-16 10:41:39 -0500 |
commit | 5d7791a208fbb87899f0b6f53f8f3e9dc048be82 (patch) | |
tree | f7a439880335754a66bfc450c676219509bbe69d /usr/local/www | |
parent | c69c58e2e7146834c48fb4c3556d2fc18bfd691e (diff) | |
download | pfsense-5d7791a208fbb87899f0b6f53f8f3e9dc048be82.zip pfsense-5d7791a208fbb87899f0b6f53f8f3e9dc048be82.tar.gz |
Ensure style is set to a valid item
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/status_rrd_graph.php | 14 |
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 e336c98..5b393fe 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( |