luci-base: form.js: fix AbstractValue.textvalue() for uci list options

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>
This commit is contained in:
Jo-Philipp Wich 2021-04-16 17:29:32 +02:00
parent 6cda999e80
commit 5c792aefc7

View file

@ -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;
},