diff options
Diffstat (limited to 'type/Base.class.php')
-rw-r--r-- | type/Base.class.php | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/type/Base.class.php b/type/Base.class.php index 61973c9..90056cf 100644 --- a/type/Base.class.php +++ b/type/Base.class.php | |||
@@ -137,13 +137,8 @@ class Type_Base { | |||
137 | } | 137 | } |
138 | 138 | ||
139 | function rrd_escape($value) { | 139 | function rrd_escape($value) { |
140 | if ($this->graph_type == 'canvas') { | 140 | # http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html#IEscaping_the_colon |
141 | # http://oss.oetiker.ch/rrdtool/doc/rrdgraph_graph.en.html#IEscaping_the_colon | 141 | return str_replace(':', '\:', $value); |
142 | return str_replace(':', '\:', $value); | ||
143 | } else { | ||
144 | # php needs it double escaped to execute rrdtool correctly | ||
145 | return str_replace(':', '\\\:', $value); | ||
146 | } | ||
147 | } | 142 | } |
148 | 143 | ||
149 | function parse_filename($file) { | 144 | function parse_filename($file) { |
@@ -151,9 +146,6 @@ class Type_Base { | |||
151 | $file = str_replace($this->datadir . '/', '', $file); | 146 | $file = str_replace($this->datadir . '/', '', $file); |
152 | # rawurlencode all but / | 147 | # rawurlencode all but / |
153 | $file = 'rrd.php?' . str_replace('%2F', '/', rawurlencode($file)); | 148 | $file = 'rrd.php?' . str_replace('%2F', '/', rawurlencode($file)); |
154 | } else { | ||
155 | # escape characters | ||
156 | $file = str_replace(array(' ', '(', ')'), array('\ ', '\(', '\)'), $file); | ||
157 | } | 149 | } |
158 | return $this->rrd_escape($file); | 150 | return $this->rrd_escape($file); |
159 | } | 151 | } |