aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/type
diff options
context:
space:
mode:
authorJohan Bergström2013-11-14 11:21:53 +1100
committerJohan Bergström2013-11-14 11:21:53 +1100
commitdfffe469d56c9bd46265ae1b2482678b93b6e66d (patch)
treec7a7fc903b30279048f97a29ab798a42e8a4eae7 /type
parentRevert "type: fix undefined index in ds_names[$source] before empty check" (diff)
downloadapt-panopticon_cgp-dfffe469d56c9bd46265ae1b2482678b93b6e66d.zip
apt-panopticon_cgp-dfffe469d56c9bd46265ae1b2482678b93b6e66d.tar.gz
apt-panopticon_cgp-dfffe469d56c9bd46265ae1b2482678b93b6e66d.tar.bz2
apt-panopticon_cgp-dfffe469d56c9bd46265ae1b2482678b93b6e66d.tar.xz
Escape parentheses in filenames
The IPMI collectd plugin uses parentheses in filenames (`fanspeed-FAN 1 fan_cooling (29.1).rrd`), so we need to escape them before passing them to rrdtool.
Diffstat (limited to 'type')
-rw-r--r--type/Default.class.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/type/Default.class.php b/type/Default.class.php
index 57b505f..8704d06 100644
--- a/type/Default.class.php
+++ b/type/Default.class.php
@@ -126,8 +126,8 @@ class Type_Default {
126 # rawurlencode all but / 126 # rawurlencode all but /
127 $file = str_replace('%2F', '/', rawurlencode($file)); 127 $file = str_replace('%2F', '/', rawurlencode($file));
128 } else { 128 } else {
129 # escape spaces 129 # escape characters
130 $file = str_replace(' ', '\ ', $file); 130 $file = str_replace(array(' ', '(', ')'), array('\ ', '\(', '\)'), $file);
131 } 131 }
132 return $this->rrd_escape($file); 132 return $this->rrd_escape($file);
133 } 133 }