X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-vnstat%2Fluasrc%2Fview%2Fvnstat.htm;h=42d7d2404b8b37e6b644682571f29576c29f59f9;hp=578bbc92d55ee7b044a96fe7b22841a963b96a15;hb=c0d9c4f3ce7bda19081d0da01a599bec067338a3;hpb=7a3493b1f7d75a3945279115324cf2ff4da26b7b diff --git a/applications/luci-app-vnstat/luasrc/view/vnstat.htm b/applications/luci-app-vnstat/luasrc/view/vnstat.htm index 578bbc92d..42d7d2404 100644 --- a/applications/luci-app-vnstat/luasrc/view/vnstat.htm +++ b/applications/luci-app-vnstat/luasrc/view/vnstat.htm @@ -1,5 +1,5 @@ <%# - Copyright 2010 Jo-Philipp Wich + Copyright 2010 Jo-Philipp Wich Licensed to the public under the Apache License 2.0. -%> @@ -21,12 +21,13 @@ style = (style and #style > 0) and style or "s" -- render image -- if iface then - style = style:gsub("[^%w]", "") - iface = iface:gsub("[^%w%.%-]", "") - luci.http.prepare_content("image/png") - local png = io.popen("vnstati -i '%s' '-%s' -o -" % { iface, style }) + local png = io.popen("vnstati -i %s -%s -o -" %{ + utl.shellquote(iface), + utl.shellquote(style) + }) + luci.http.write(png:read("*a")) png:close() @@ -56,7 +57,7 @@ dbdir = dbdir or "/var/lib/vnstat" <%+header%> -

<%:VnStat Graphs%>

+

<%:VnStat Graphs%>

@@ -89,7 +90,7 @@ dbdir = dbdir or "/var/lib/vnstat" <% end end - end + end %> <% if empty then %>