aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/functions.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/functions.inc.php')
-rw-r--r--inc/functions.inc.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/inc/functions.inc.php b/inc/functions.inc.php
new file mode 100644
index 0000000..2906530
--- /dev/null
+++ b/inc/functions.inc.php
@@ -0,0 +1,27 @@
1<?php
2
3# global functions
4
5function validate_get($value, $type) {
6 switch($type) {
7 case 'host':
8 if (!preg_match('/^[\d\w\W]+$/', $value))
9 return NULL;
10 break;
11 case 'plugin':
12 case 'type':
13 if (!preg_match('/^\w+$/', $value))
14 return NULL;
15 break;
16 case 'pinstance':
17 case 'tinstance':
18 if (!preg_match('/^[\d\w-]+$/', $value))
19 return NULL;
20 break;
21 }
22
23 return $value;
24}
25
26
27?>