diff options
author | Pim van den Berg | 2014-07-23 23:02:36 +0200 |
---|---|---|
committer | Pim van den Berg | 2014-07-23 23:04:52 +0200 |
commit | b1be9bbba1c2428a8083f9014bfaeed8cdca15c4 (patch) | |
tree | b5be0b539b15c6a4cc592037e867fbbfe2c77b1f | |
parent | Update html.inc.php (diff) | |
download | apt-panopticon_cgp-b1be9bbba1c2428a8083f9014bfaeed8cdca15c4.zip apt-panopticon_cgp-b1be9bbba1c2428a8083f9014bfaeed8cdca15c4.tar.gz apt-panopticon_cgp-b1be9bbba1c2428a8083f9014bfaeed8cdca15c4.tar.bz2 apt-panopticon_cgp-b1be9bbba1c2428a8083f9014bfaeed8cdca15c4.tar.xz |
type/base: stop escaping characters manually since we use escapeshellarg()
Closes #89
-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 | } |