Skip to content

Commit 8af3bef

Browse files
committed
better practice
1 parent 6d0ab7e commit 8af3bef

File tree

1 file changed

+4
-3
lines changed
  • services/static-webserver/client/source/class/osparc/ui/basic

1 file changed

+4
-3
lines changed

services/static-webserver/client/source/class/osparc/ui/basic/SafeLabel.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
qx.Class.define("osparc.ui.basic.SafeLabel", {
2323
extend: qx.ui.basic.Label,
2424

25-
construct(...args) {
26-
this.addListener("changeValue", this._onChangeValue, this);
25+
construct(value) {
26+
const sanitized = value && typeof value === "string" ? osparc.wrapper.DOMPurify.sanitize(value) : null;
27+
this.base(arguments, sanitized);
2728

28-
this.base(arguments, ...args);
29+
this.addListener("changeValue", this._onChangeValue, this);
2930

3031
this.set({
3132
rich: true,

0 commit comments

Comments
 (0)