From dfffe469d56c9bd46265ae1b2482678b93b6e66d Mon Sep 17 00:00:00 2001 From: Johan Bergström Date: Thu, 14 Nov 2013 11:21:53 +1100 Subject: 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.--- type/Default.class.php | 4 ++-- 1 file 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 { # rawurlencode all but / $file = str_replace('%2F', '/', rawurlencode($file)); } else { - # escape spaces - $file = str_replace(' ', '\ ', $file); + # escape characters + $file = str_replace(array(' ', '(', ')'), array('\ ', '\(', '\)'), $file); } return $this->rrd_escape($file); } -- cgit v1.1