diff options
author | Pim van den Berg | 2013-08-04 15:29:46 +0200 |
---|---|---|
committer | Pim van den Berg | 2013-08-04 15:29:46 +0200 |
commit | 362e8c3910ff77d7ace31d2496df553831bbc93f (patch) | |
tree | e0a46e420355b4a84309f07d7538b59962cc5c70 /type | |
parent | type/default: double escape colon in legend/filename when not using canvas (diff) | |
download | apt-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.php | 2 |
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 | } |