summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/htdocs/luci-static/resources/view
diff options
context:
space:
mode:
authorKristian Skramstad <kristian+github@83.no>2024-05-15 09:59:21 +0200
committerPaul Donald <newtwen+github@gmail.com>2024-05-16 00:15:45 +0200
commitc4eaea70c78e8a46f98047cbcff6326bfccafe3a (patch)
treeb634064b8d4ec853b0d09fc8ad1cea5ab7a3734d /modules/luci-mod-system/htdocs/luci-static/resources/view
parent13dd9c423143f6ab4ed4392ae922c1449c3bbf87 (diff)
luci-mod-system: flash.js: fix mtdname on download
The previous change did not work as intended for partitions with _ in the name. I.e "0:qsee_1". It would output an error "Invalid characters in filename". So fix this by matching and replacing any character except for a-z and 0-9 with "-". Example "0:qsee_1" = I.e "0-qsee-1". Signed-off-by: Kristian Skramstad <kristian+github@83.no>
Diffstat (limited to 'modules/luci-mod-system/htdocs/luci-static/resources/view')
-rw-r--r--modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
index 6c67859f12..2ef096f5f2 100644
--- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
+++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/flash.js
@@ -172,7 +172,7 @@ return view.extend({
handleBlock: function(hostname, ev) {
var mtdblock = dom.parent(ev.target, '.cbi-section').querySelector('[data-name="mtdselect"] select');
var mtdnumber = mtdblock.value;
- var mtdname = mtdblock.selectedOptions[0].text;
+ var mtdname = mtdblock.selectedOptions[0].text.replace(/([^a-zA-Z0-9]+)/g, '-');
var form = E('form', {
'method': 'post',
'action': L.env.cgi_base + '/cgi-download',