@luigi-project/core-modular 0.0.20-dev.202610290037 → 0.0.20-dev.202610300037
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.
- package/luigi.js +23 -4
- package/luigi.js.map +1 -1
- package/package.json +1 -1
- package/utilities/helpers/escaping-helpers.d.ts +1 -0
package/luigi.js
CHANGED
|
@@ -7103,6 +7103,21 @@ var ui = {
|
|
|
7103
7103
|
sanitizeParam(e = "") {
|
|
7104
7104
|
return String(e).replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/");
|
|
7105
7105
|
},
|
|
7106
|
+
sanitizeExternalNavigationUrl(e = "") {
|
|
7107
|
+
try {
|
|
7108
|
+
let t = "https://sentinel.invalid", n = new URL(e, t);
|
|
7109
|
+
if (!["http:", "https:"].includes(n.protocol)) return;
|
|
7110
|
+
let r = n.origin === t, i = n.pathname;
|
|
7111
|
+
if (i === "/") {
|
|
7112
|
+
let t = String(e);
|
|
7113
|
+
(r ? t : t.slice((n.protocol + "//" + n.host).length)).startsWith("/") || (i = "");
|
|
7114
|
+
}
|
|
7115
|
+
return r ? i + n.search + n.hash : n.protocol + "//" + n.host + i + n.search + n.hash;
|
|
7116
|
+
} catch {
|
|
7117
|
+
console.warn(`Blocked unsafe external navigation URL: ${e}`);
|
|
7118
|
+
return;
|
|
7119
|
+
}
|
|
7120
|
+
},
|
|
7106
7121
|
escapeKeyForRegexp(e = "") {
|
|
7107
7122
|
return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
7108
7123
|
},
|
|
@@ -7274,10 +7289,14 @@ var ui = {
|
|
|
7274
7289
|
},
|
|
7275
7290
|
openExternalLink(e, t) {
|
|
7276
7291
|
let n = e.url;
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7292
|
+
t && (n = a.replaceVars(n, t, ":", !1));
|
|
7293
|
+
let r = ui.sanitizeExternalNavigationUrl(n);
|
|
7294
|
+
if (r) {
|
|
7295
|
+
if (e.sameWindow) window.location.href = r;
|
|
7296
|
+
else {
|
|
7297
|
+
let e = window.open(r, "_blank", "noopener noreferrer");
|
|
7298
|
+
e && (e.opener = null, e.focus());
|
|
7299
|
+
}
|
|
7281
7300
|
}
|
|
7282
7301
|
}
|
|
7283
7302
|
}, U = {
|