diff options
author | Pim van den Berg | 2013-05-18 16:05:43 +0200 |
---|---|---|
committer | Pim van den Berg | 2013-05-18 16:08:09 +0200 |
commit | 5793a8cd003643974206e44ea752ab0966cfa8c0 (patch) | |
tree | 387a6a327af9834f2986ad3316be2183949d897a /inc/functions.inc.php | |
parent | jsrrdgraph: RrdGraph.js: fix undefined 2nd argument of RrdVdef function (diff) | |
download | apt-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.php | 15 |
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 | ||
33 | function 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 | |||
33 | function crc32hex($str) { | 48 | function crc32hex($str) { |
34 | return sprintf("%x",crc32($str)); | 49 | return sprintf("%x",crc32($str)); |
35 | } | 50 | } |