diff options
Diffstat (limited to '')
-rw-r--r-- | host.php | 2 | ||||
-rw-r--r-- | inc/functions.inc.php | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -15,7 +15,7 @@ printf("<fieldset id=\"%s\">", htmlentities($host)); | |||
15 | printf("<legend>%s</legend>", htmlentities($host)); | 15 | printf("<legend>%s</legend>", htmlentities($host)); |
16 | 16 | ||
17 | 17 | ||
18 | if (!$plugins = collectd_plugins($host)) { | 18 | if (!strlen($host) || !$plugins = collectd_plugins($host)) { |
19 | echo "Unknown host\n"; | 19 | echo "Unknown host\n"; |
20 | return false; | 20 | return false; |
21 | } | 21 | } |
diff --git a/inc/functions.inc.php b/inc/functions.inc.php index fed4b10..c32b3ef 100644 --- a/inc/functions.inc.php +++ b/inc/functions.inc.php | |||
@@ -11,7 +11,7 @@ function GET($index) { | |||
11 | function validate_get($value, $type) { | 11 | function validate_get($value, $type) { |
12 | switch($type) { | 12 | switch($type) { |
13 | case 'host': | 13 | case 'host': |
14 | if (!preg_match('/^[\d\w\W]+$/u', $value)) | 14 | if (!preg_match('/^[\w-.]+$/u', $value)) |
15 | return NULL; | 15 | return NULL; |
16 | break; | 16 | break; |
17 | case 'plugin': | 17 | case 'plugin': |
@@ -22,7 +22,7 @@ function validate_get($value, $type) { | |||
22 | break; | 22 | break; |
23 | case 'pinstance': | 23 | case 'pinstance': |
24 | case 'tinstance': | 24 | case 'tinstance': |
25 | if (!preg_match('/^[\d\w-]+$/u', $value)) | 25 | if (!preg_match('/^[\w-]+$/u', $value)) |
26 | return NULL; | 26 | return NULL; |
27 | break; | 27 | break; |
28 | } | 28 | } |