aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/graph.php
diff options
context:
space:
mode:
Diffstat (limited to 'graph.php')
-rw-r--r--graph.php14
1 files changed, 4 insertions, 10 deletions
diff --git a/graph.php b/graph.php
index cc3aeb1..77bfcb6 100644
--- a/graph.php
+++ b/graph.php
@@ -2,26 +2,20 @@
2 2
3require_once 'conf/common.inc.php'; 3require_once 'conf/common.inc.php';
4 4
5$host = $_GET['h'];
6$plugin = $_GET['p'];
7$pinstance = $_GET['pi'];
8$type = $_GET['t'];
9$tinstance = $_GET['ti'];
10$width = empty($_GET['x']) ? $CONFIG['width'] : $_GET['x']; 5$width = empty($_GET['x']) ? $CONFIG['width'] : $_GET['x'];
11$heigth = empty($_GET['y']) ? $CONFIG['heigth'] : $_GET['y']; 6$heigth = empty($_GET['y']) ? $CONFIG['heigth'] : $_GET['y'];
12$seconds = $_GET['s'];
13 7
14if (!preg_match('/^[a-z]+$/', $plugin)) { 8if (!preg_match('/^[a-z]+$/', $_GET['p'])) {
15 die_img('Error: plugin contains unknown characters.'); 9 die_img('Error: plugin contains unknown characters.');
16 exit; 10 exit;
17} 11}
18 12
19if (!file_exists($CONFIG['webdir']."/plugin/$plugin.php")) { 13if (!file_exists($CONFIG['webdir'].'/plugin/'.$_GET['p'].'.php')) {
20 die_img(sprintf('Error: plugin not available (%s).', $plugin)); 14 die_img(sprintf('Error: plugin not available (%s).', $_GET['p']));
21 exit; 15 exit;
22} 16}
23 17
24include $CONFIG['webdir']."/plugin/$plugin.php"; 18include $CONFIG['webdir'].'/plugin/'.$_GET['p'].'.php';
25 19
26 20
27function die_img($msg) { 21function die_img($msg) {