From: Martin Surovcak Date: Wed, 3 Apr 2019 22:32:13 +0000 (+0200) Subject: luci-app-statistics - allow rrd files to contain : X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F2657%2Fhead;p=oweals%2Fluci.git luci-app-statistics - allow rrd files to contain : Fixes situations where RRD file name contains ":" (eg. _ping/ipv6_) in `rrdtool` it's unescaped - thus not able to render image. Adding simple escaping of `:` to `\\:` fixes the situation. Might be a solution for #958. --- diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua index f827e9230..29090eed8 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool.lua @@ -62,7 +62,7 @@ function Graph._mkpath( self, plugin, plugin_instance, dtype, dtype_instance ) end function Graph.mkrrdpath( self, ... ) - return string.format( "%s/%s.rrd", self.opts.rrdpath, self:_mkpath( ... ) ) + return string.format( "%s/%s.rrd", self.opts.rrdpath, string.gsub(self:_mkpath( ... ), ":", "\\:") ) end function Graph.mkpngpath( self, ... )