libs/web: Prevent luci.http to prematurely parse the POST data
[project/luci.git] / applications / luci-statistics / luasrc / controller / luci_statistics / luci_statistics.lua
index be6430eed21994851d9f8cf413901c46ff926c5d..f16a655dcff50eaf204b76cd19fa11a3ca8444dd 100644 (file)
@@ -80,7 +80,7 @@ function index()
              page.setuser  = "nobody"
              page.setgroup = "nogroup"
 
-       local vars = luci.http.formvalues()
+       local vars = luci.http.formvalue(nil, true)
        local span = vars.timespan or nil
 
        for i, plugin in luci.util.vspairs( tree:plugins() ) do
@@ -148,9 +148,9 @@ function statistics_render()
        require("luci.template")
        require("luci.model.uci")
 
-       local vars  = luci.http.formvalues()
-       local req   = luci.dispatcher.request
-       local path  = luci.dispatcher.dispatched.path
+       local vars  = luci.http.formvalue()
+       local req   = luci.dispatcher.context.request
+       local path  = luci.dispatcher.context.dispatched.path
        local uci   = luci.model.uci
        local spans = luci.util.split( uci.get( "luci_statistics", "collectd_rrdtool", "RRATimespans" ), "%s+", nil, true )
        local span  = vars.timespan or uci.get( "luci_statistics", "rrdtool", "default_timespan" ) or spans[1]
@@ -160,10 +160,10 @@ function statistics_render()
        local images = { }
 
        -- find requested plugin and instance
-        for i, p in ipairs( luci.dispatcher.dispatched.path ) do
-                if luci.dispatcher.dispatched.path[i] == "graph" then
-                        plugin    = luci.dispatcher.dispatched.path[i+1]
-                        instances = { luci.dispatcher.dispatched.path[i+2] }
+        for i, p in ipairs( luci.dispatcher.context.dispatched.path ) do
+                if luci.dispatcher.context.dispatched.path[i] == "graph" then
+                        plugin    = luci.dispatcher.context.dispatched.path[i+1]
+                        instances = { luci.dispatcher.context.dispatched.path[i+2] }
                 end
         end