projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6cda999
)
luci-base: form.js: fix AbstractValue.textvalue() for uci list options
author
Jo-Philipp Wich
<jo@mein.io>
Fri, 16 Apr 2021 15:29:32 +0000
(17:29 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Fri, 16 Apr 2021 15:32:22 +0000
(17:32 +0200)
Serialize the uci list value into a space separated string before passing
it to String.format() for HTML escaping. Without that change, empty strings
were returned whenever the underlying uci get operation yieled an array.
Fixes: #4993
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/form.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/form.js
b/modules/luci-base/htdocs/luci-static/resources/form.js
index 58a31dddb2ebce6af8be0965aa2df04b2d687e0f..f7b4c64f8fe2c8cb045a14b9e43d0ab584a375b4 100644
(file)
--- a/
modules/luci-base/htdocs/luci-static/resources/form.js
+++ b/
modules/luci-base/htdocs/luci-static/resources/form.js
@@
-1862,6
+1862,9
@@
var CBIAbstractValue = CBIAbstractElement.extend(/** @lends LuCI.form.AbstractVa
if (cval == null)
cval = this.default;
+ if (Array.isArray(cval))
+ cval = cval.join(' ');
+
return (cval != null) ? '%h'.format(cval) : null;
},