luci-base: ui.js: ensure that select choice labels are properly escaped
authorJo-Philipp Wich <jo@mein.io>
Wed, 4 Dec 2019 17:04:20 +0000 (18:04 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 4 Dec 2019 17:07:26 +0000 (18:07 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 71d370a964f3ec4970bcded9198ff559316902ff)

modules/luci-base/htdocs/luci-static/resources/ui.js

index f90de9e73a3b4a411dfbc228922a607483d7513a..7f13e249a9751918c7620af624d48efb55fc7fd9 100644 (file)
@@ -312,7 +312,7 @@ var UISelect = UIElement.extend({
                                frameEl.lastChild.appendChild(E('option', {
                                        'value': '',
                                        'selected': (this.values.length == 0 || this.values[0] == '') ? '' : null
-                               }, this.choices[''] || this.options.placeholder || _('-- Please choose --')));
+                               }, [ this.choices[''] || this.options.placeholder || _('-- Please choose --') ]));
 
                        for (var i = 0; i < keys.length; i++) {
                                if (keys[i] == null || keys[i] == '')
@@ -321,7 +321,7 @@ var UISelect = UIElement.extend({
                                frameEl.lastChild.appendChild(E('option', {
                                        'value': keys[i],
                                        'selected': (this.values.indexOf(keys[i]) > -1) ? '' : null
-                               }, this.choices[keys[i]] || keys[i]));
+                               }, [ this.choices[keys[i]] || keys[i] ]));
                        }
                }
                else {