From 2a337e593359fb03472d1a6c4155971942b307be Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Mon, 25 May 2015 11:26:47 +0200 Subject: inc/functions: make type argument of validate_get function exactly the same as $_GET value --- inc/functions.inc.php | 12 ++++++------ inc/html.inc.php | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'inc') diff --git a/inc/functions.inc.php b/inc/functions.inc.php index abe0763..f667772 100644 --- a/inc/functions.inc.php +++ b/inc/functions.inc.php @@ -10,18 +10,18 @@ function GET($index) { function validate_get($value, $type) { switch($type) { - case 'host': + case 'h': # host if (!preg_match('/^[\w-.]+$/u', $value)) return NULL; break; - case 'plugin': - case 'category': - case 'type': + case 'p': # plugin + case 'c': # category + case 't': # type if (!preg_match('/^\w+$/u', $value)) return NULL; break; - case 'pinstance': - case 'tinstance': + case 'pi': # plugin instance + case 'ti': # type instance if (!preg_match('/^[\w-]+$/u', $value)) return NULL; break; diff --git a/inc/html.inc.php b/inc/html.inc.php index cf3d15d..3998f54 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php @@ -313,15 +313,15 @@ function host_summary($cat, $hosts) { function breadcrumbs() { $path = ''; - if (validate_get(GET('h'), 'host')) + if (validate_get(GET('h'), 'h')) $path .= ' - '.ucfirst(GET('h')); - if (validate_get(GET('p'), 'plugin')) + if (validate_get(GET('p'), 'p')) $path .= ' - '.ucfirst(GET('p')); - if (validate_get(GET('pi'), 'pinstance')) + if (validate_get(GET('pi'), 'pi')) $path .= ' - '.GET('pi'); - if (validate_get(GET('t'), 'type') && validate_get(GET('p'), 'plugin') && GET('t') != GET('p')) + if (validate_get(GET('t'), 't') && validate_get(GET('p'), 'p') && GET('t') != GET('p')) $path .= ' - '.GET('t'); - if (validate_get(GET('ti'), 'tinstance')) + if (validate_get(GET('ti'), 'ti')) $path .= ' - '.GET('ti'); return $path; -- cgit v1.1