luci/modules
Daniel Dickinson b130ca554f lib-nixio / luci-base: Fix for reading csrf token prevents file upload
The call to http.formvalue in order to read the csrf token causes
_parse_input to be triggered *before* controllers and cbi maps have
been built.  This results in the failure of file uploads because
the file handler is not yet in place when _parse_input gets called,
and it is in _parse_input that POST data is parsed (including files).

To fix this we add the ability to write file fields to temporary
files (using mkstemp and unlink in nixio.file) and use this to
store file data until the filehandler is registered, with a
fallback to reading the file data into memory.

Once the filehandler callback gets registered we iterate
though all previously parsed (saved) files and copy the
data to the file handler, and then close the temporary
file (which finally removes because we unlinked after
creating the file, but didn't close the file so unlink
was deferred).

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
2015-12-15 13:12:29 -05:00
..
luci-base lib-nixio / luci-base: Fix for reading csrf token prevents file upload 2015-12-15 13:12:29 -05:00
luci-mod-admin-full validation: Add option ipv4only option to host and hostport datatypes 2015-12-15 13:12:10 -05:00
luci-mod-admin-mini Globally convert headline anchors into name attributes. 2015-10-06 13:30:33 +02:00
luci-mod-failsafe Globally convert headline anchors into name attributes. 2015-10-06 13:30:33 +02:00
luci-mod-freifunk Globally replace luci.dispatcher.build_url(...) with url(...) invocations 2015-10-07 19:07:36 +02:00
luci-mod-freifunk-community Rework LuCI build system 2015-01-08 16:26:20 +01:00
luci-mod-rpc modules/luci-mod-rpc: fix attempt to index global 'luci' (a nil value) 2015-09-12 15:11:18 +06:00