@basthon/gui-base 0.62.14 → 0.62.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/main.js +7 -1
  2. package/package.json +5 -5
package/lib/main.js CHANGED
@@ -91,7 +91,13 @@ export class GUIBase {
91
91
  message = (_b = (_a = error) === null || _a === void 0 ? void 0 : _a.reason) === null || _b === void 0 ? void 0 : _b.message;
92
92
  if (message == null)
93
93
  message = error.toString();
94
- message = message.split("\n").join("<br>");
94
+ // avoid html injection on errors
95
+ const encodeHTMLEntities = (text) => {
96
+ var textArea = document.createElement("textarea");
97
+ textArea.innerText = text;
98
+ return textArea.innerHTML;
99
+ };
100
+ message = encodeHTMLEntities(message).split("\n").join("<br>");
95
101
  this.error("Erreur", `Erreur : ${message}`);
96
102
  // In case of error, force loader hiding.
97
103
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basthon/gui-base",
3
- "version": "0.62.14",
3
+ "version": "0.62.21",
4
4
  "description": "Basthon - Base GUI",
5
5
  "homepage": "https://basthon.fr",
6
6
  "bugs": {
@@ -25,9 +25,9 @@
25
25
  "clean": "rm -rf lib/"
26
26
  },
27
27
  "dependencies": {
28
- "@basthon/checkpoints": "0.62.14",
29
- "@basthon/kernel-base": "0.62.14",
30
- "@basthon/kernel-loader": "0.62.14",
28
+ "@basthon/checkpoints": "0.62.21",
29
+ "@basthon/kernel-base": "0.62.21",
30
+ "@basthon/kernel-loader": "0.62.21",
31
31
  "js-base64": "^3.7.2",
32
32
  "pako": "^2.0.4",
33
33
  "promise-delegate": "^1.0.1"
@@ -41,5 +41,5 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "90caf34f771697e20e1c2ac2089a496ab54c67da"
44
+ "gitHead": "59343558e9ae17fbb08eda1e81a36b182e572d05"
45
45
  }