aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type
diff options
context:
space:
mode:
authorPim van den Berg2013-08-04 15:29:46 +0200
committerPim van den Berg2013-08-04 15:29:46 +0200
commit362e8c3910ff77d7ace31d2496df553831bbc93f (patch)
treee0a46e420355b4a84309f07d7538b59962cc5c70 /type
parenttype/default: double escape colon in legend/filename when not using canvas (diff)
downloadapt-panopticon_cgp-362e8c3910ff77d7ace31d2496df553831bbc93f.zip
apt-panopticon_cgp-362e8c3910ff77d7ace31d2496df553831bbc93f.tar.gz
apt-panopticon_cgp-362e8c3910ff77d7ace31d2496df553831bbc93f.tar.bz2
apt-panopticon_cgp-362e8c3910ff77d7ace31d2496df553831bbc93f.tar.xz
type/default: urlencode filenames when using canvas
Since commit v0.3-97-g5793a8c [integrate jsrrdgraph in CGP], double quotes have been removed around filenames and legend because it shouldn't be necessary (and jsrrdgraph didn't support it). This broke graphs rendered using jsrrdgraph with files including spaces in it's name. Hopefully this is fixed now by rawurlencoding them (but the /).
Diffstat (limited to 'type')
-rw-r--r--type/Default.class.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/type/Default.class.php b/type/Default.class.php
index 01718e4..0d3971f 100644
--- a/type/Default.class.php
+++ b/type/Default.class.php
@@ -123,6 +123,8 @@ class Type_Default {
123 function parse_filename($file) { 123 function parse_filename($file) {
124 if ($this->graph_type == 'canvas') { 124 if ($this->graph_type == 'canvas') {
125 $file = 'rrd.php/' . str_replace($this->datadir . '/', '', $file); 125 $file = 'rrd.php/' . str_replace($this->datadir . '/', '', $file);
126 # rawurlencode all but /
127 $file = str_replace('%2F', '/', rawurlencode($file));
126 } 128 }
127 return $this->rrd_escape($file); 129 return $this->rrd_escape($file);
128 } 130 }