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.
This commit is contained in:
Martin Surovcak 2019-04-04 00:32:13 +02:00
parent d679b93bad
commit 7bab4a3ef2
No known key found for this signature in database
GPG key ID: 116C16BC0A711210

View file

@ -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, ... )