text: sanitize html (escape "<" & ">") (#562)

This commit is contained in:
bordun 2019-09-11 10:44:04 +02:00
parent 65bb430512
commit b332cae3a5
2 changed files with 2 additions and 1 deletions

View file

@ -57,7 +57,7 @@ module.exports = class Text extends Widget {
setValue(v, options={}) {
this.value = v==null ? this.defaultValue : v
this.widget.innerHTML = iconify(String(this.value).replace(/\n/g,'<br/>'))
this.widget.innerHTML = iconify(String(this.value).replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g,'<br/>'))
if (options.sync) this.changed(options)