diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-17 02:32:47 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-17 02:32:47 +0100 |
commit | 31816e92f109e0c534f176ca1e79b032917c876c (patch) | |
tree | 644be4426122b92673d1329e0313b93fface7275 /modules/luci-base/luasrc/view | |
parent | 3dfa111db87de7c5059cb6521c6e05b7f56af195 (diff) | |
parent | b475ec699d0c16c4ac7f4abb7680c7e6011428f4 (diff) |
Merge pull request #577 from cshore/pull-request-safe-file-upload
luci-base: Make default for FileUpload 'safe'
Diffstat (limited to 'modules/luci-base/luasrc/view')
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/upload.htm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/upload.htm b/modules/luci-base/luasrc/view/cbi/upload.htm index 7770934111..157f3b36fa 100644 --- a/modules/luci-base/luasrc/view/cbi/upload.htm +++ b/modules/luci-base/luasrc/view/cbi/upload.htm @@ -6,9 +6,19 @@ <%+cbi/valueheader%> <% if s then %> <%:Uploaded File%> (<%=t.byte_format(s.size)%>) - <input type="hidden"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> /> - <input class="cbi-button cbi-input-image" type="image" value="<%:Replace entry%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:Replace entry%>" title="<%:Replace entry%>" src="<%=resource%>/cbi/reload.gif" /> - <% else %> + <% if self.unsafeupload then %> + <input type="hidden"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> /> + <input class="cbi-button cbi-input-image" type="image" value="<%:Replace entry%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:Replace entry%>" title="<%:Replace entry%>" src="<%=resource%>/cbi/reload.gif" /> + <% end %> + <% end %> + + <% if not self.unsafeupload then %> + <input type="hidden"<%= attr("value", v) .. attr("name", "cbi.rlf." .. section .. "." .. self.option) .. attr("id", "cbi.rlf." .. section .. "." .. self.option) %> /> + <% end %> + + <% if (not s) or (s and not self.unsafeupload) then %> <input class="cbi-input-file" type="file"<%= attr("name", cbid) .. attr("id", cbid) %> /> <% end %> + <input type="text" class="cbi-input-text" onchange="cbi_d_update(this.id)"<%= + attr("name", cbid .. ".textbox") .. attr("id", cbid .. ".textbox") .. attr("value", luci.cbi.AbstractValue.cfgvalue(self, section) or self.default) .. ifattr(self.size, "size") .. ifattr(self.placeholder, "placeholder") .. ifattr(self.readonly, "readonly") .. ifattr(self.maxlength, "maxlength") %> /> <%+cbi/valuefooter%> |