diff options
author | Pim van den Berg | 2013-08-04 15:19:42 +0200 |
---|---|---|
committer | Pim van den Berg | 2013-08-04 15:19:42 +0200 |
commit | 882144a0f97eb3fa54552f0a78970a1c09d7c41e (patch) | |
tree | 8aa56eba1b907d6eb51e72a7f57491b039e9dd94 | |
parent | plugin/ping: improve descriptions (diff) | |
download | apt-panopticon_cgp-882144a0f97eb3fa54552f0a78970a1c09d7c41e.zip apt-panopticon_cgp-882144a0f97eb3fa54552f0a78970a1c09d7c41e.tar.gz apt-panopticon_cgp-882144a0f97eb3fa54552f0a78970a1c09d7c41e.tar.bz2 apt-panopticon_cgp-882144a0f97eb3fa54552f0a78970a1c09d7c41e.tar.xz |
type/default: double escape colon in legend/filename when not 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 by rrdtool with files including a colon in it's
name. Hopefully this is fixed now by double escaping them.
Reported-by: Poil <poil@quake.fr> (https://github.com/pommi/CGP/issues/20)
Diffstat (limited to '')
-rw-r--r-- | type/Default.class.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/type/Default.class.php b/type/Default.class.php index 416a352..01718e4 100644 --- a/type/Default.class.php +++ b/type/Default.class.php | |||
@@ -111,7 +111,13 @@ class Type_Default { | |||
111 | } | 111 | } |
112 | 112 | ||
113 | function rrd_escape($value) { | 113 | function rrd_escape($value) { |
114 | return str_replace(':', '\:', $value); | 114 | if ($this->graph_type == 'canvas') { |
115 | # http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html#IEscaping_the_colon | ||
116 | return str_replace(':', '\:', $value); | ||
117 | } else { | ||
118 | # php needs it double escaped to execute rrdtool correctly | ||
119 | return str_replace(':', '\\\:', $value); | ||
120 | } | ||
115 | } | 121 | } |
116 | 122 | ||
117 | function parse_filename($file) { | 123 | function parse_filename($file) { |