aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/functions.inc.php
diff options
context:
space:
mode:
authorPim van den Berg2013-05-18 16:05:43 +0200
committerPim van den Berg2013-05-18 16:08:09 +0200
commit5793a8cd003643974206e44ea752ab0966cfa8c0 (patch)
tree387a6a327af9834f2986ad3316be2183949d897a /inc/functions.inc.php
parentjsrrdgraph: RrdGraph.js: fix undefined 2nd argument of RrdVdef function (diff)
downloadapt-panopticon_cgp-5793a8cd003643974206e44ea752ab0966cfa8c0.zip
apt-panopticon_cgp-5793a8cd003643974206e44ea752ab0966cfa8c0.tar.gz
apt-panopticon_cgp-5793a8cd003643974206e44ea752ab0966cfa8c0.tar.bz2
apt-panopticon_cgp-5793a8cd003643974206e44ea752ab0966cfa8c0.tar.xz
integrate jsrrdgraph in CGP
Diffstat (limited to 'inc/functions.inc.php')
-rw-r--r--inc/functions.inc.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/inc/functions.inc.php b/inc/functions.inc.php
index a72a589..6642e51 100644
--- a/inc/functions.inc.php
+++ b/inc/functions.inc.php
@@ -30,6 +30,21 @@ function validate_get($value, $type) {
30 return $value; 30 return $value;
31} 31}
32 32
33function validateRRDPath($base, $path) {
34 $realpath = realpath(sprintf('%s/%s', $base, $path));
35
36 if (strpos($realpath, $base) === false)
37 return false;
38
39 if (strpos($realpath, $base) !== 0)
40 return false;
41
42 if (!preg_match('/\.rrd$/', $realpath))
43 return false;
44
45 return $realpath;
46}
47
33function crc32hex($str) { 48function crc32hex($str) {
34 return sprintf("%x",crc32($str)); 49 return sprintf("%x",crc32($str));
35} 50}