From 82623b7658882006c7a08c4a8330d7ddab054a37 Mon Sep 17 00:00:00 2001 From: sepich Date: Mon, 10 Mar 2014 11:06:47 -0700 Subject: mod_rewrite final cleanup --- rrd.php | 2 +- type/Default.class.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rrd.php b/rrd.php index 1b5997b..b4c7f68 100644 --- a/rrd.php +++ b/rrd.php @@ -4,7 +4,7 @@ require_once 'conf/common.inc.php'; require_once 'inc/functions.inc.php'; require_once 'inc/html.inc.php'; -if ($file = validateRRDPath($CONFIG['datadir'], $_SERVER['PATH_INFO'])) { +if ( $file = validateRRDPath($CONFIG['datadir'], urldecode($_SERVER["QUERY_STRING"])) ) { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header("Expires: " .date(DATE_RFC822,strtotime($CONFIG['cache']." seconds"))); diff --git a/type/Default.class.php b/type/Default.class.php index 5e19e73..c4fa8a9 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -122,9 +122,9 @@ class Type_Default { function parse_filename($file) { if ($this->graph_type == 'canvas') { - $file = 'rrd.php/' . str_replace($this->datadir . '/', '', $file); + $file = str_replace($this->datadir . '/', '', $file); # rawurlencode all but / - $file = str_replace('%2F', '/', rawurlencode($file)); + $file = 'rrd.php?' . str_replace('%2F', '/', rawurlencode($file)); } else { # escape characters $file = str_replace(array(' ', '(', ')'), array('\ ', '\(', '\)'), $file); -- cgit v1.1