From: Jo-Philipp Wich Date: Wed, 7 Oct 2009 19:50:20 +0000 (+0000) Subject: libs/cbi: fix wrong value handling in FileUpload widgets (#85) X-Git-Tag: 0.10.0~1120 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=da2b40c9e3ecbc3e1a231d78606e6193aab5544e;p=oweals%2Fluci.git libs/cbi: fix wrong value handling in FileUpload widgets (#85) --- diff --git a/libs/cbi/luasrc/view/cbi/upload.htm b/libs/cbi/luasrc/view/cbi/upload.htm index 7bde74b48..355f37357 100644 --- a/libs/cbi/luasrc/view/cbi/upload.htm +++ b/libs/cbi/luasrc/view/cbi/upload.htm @@ -1,7 +1,7 @@ <%# LuCI - Lua Configuration Interface Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich +Copyright 2008-2009 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,11 +16,11 @@ $Id$ <% local t = require("luci.tools.webadmin") local v = self:cfgvalue(section) - v = v and nixio.fs.stat(v) + local s = v and nixio.fs.stat(v) -%> <%+cbi/valueheader%> - <% if v then %> - <%:cbi_upload Uploaded File%> (<%=t.byte_format(v.size)%>) + <% if s then %> + <%:cbi_upload Uploaded File%> (<%=t.byte_format(s.size)%>) /> " alt="<%:cbi_replace%>" title="<%:cbi_replace%>" src="<%=resource%>/cbi/reload.gif" /> <% else %>