From e817ad19f912994f56743f2934f5345991cb25a5 Mon Sep 17 00:00:00 2001 From: Warren Baker Date: Wed, 9 Jan 2013 23:00:58 +0200 Subject: Make values look a little prettier and prevent a potential problem --- usr/local/www/diag_system_pftop.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'usr') diff --git a/usr/local/www/diag_system_pftop.php b/usr/local/www/diag_system_pftop.php index 673d226..78e458b 100644 --- a/usr/local/www/diag_system_pftop.php +++ b/usr/local/www/diag_system_pftop.php @@ -44,8 +44,10 @@ $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); $pgtitle = gettext("Diagnostics: pfTop"); +$sorttypes = array('age', 'bytes', 'dest', 'dport', 'exp', 'none', 'peak', 'pkt', 'rate', 'size', 'sport', 'src'); + if($_REQUEST['getactivity']) { - if($_REQUEST['sorttype']) + if($_REQUEST['sorttype'] && in_array($_REQUEST['sorttype'], array_keys($sorttypes))) $sorttype = escapeshellarg($_REQUEST['sorttype']); else $sorttype = gettext("bytes"); @@ -56,7 +58,7 @@ if($_REQUEST['getactivity']) { include("head.inc"); -if($_REQUEST['sorttype']) +if($_REQUEST['sorttype'] && in_array($_REQUEST['sorttype'], array_keys($sorttypes))) $sorttype = htmlentities($_REQUEST['sorttype']); else $sorttype = gettext("bytes"); @@ -98,19 +100,18 @@ else

-- cgit v1.1