@ecency/render-helper 2.5.32 → 2.5.34
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/dist/node/index.cjs
CHANGED
|
@@ -774,7 +774,6 @@ var isSafeNavValue = (value) => {
|
|
|
774
774
|
const isRelative = /^(\/\/|\/[^/]?|#|\?|[a-z0-9._\-]+(\/|$))/i.test(trimmed);
|
|
775
775
|
return isSafeScheme || isRelative;
|
|
776
776
|
};
|
|
777
|
-
var decodeEntities2 = (input) => input.replace(/&#(\d+);?/g, (_, dec) => String.fromCodePoint(Number(dec))).replace(/&#x([0-9a-f]+);?/gi, (_, hex) => String.fromCodePoint(parseInt(hex, 16)));
|
|
778
777
|
var isProxyPSrcset = (srcset) => {
|
|
779
778
|
const base = trimTrailingSlash(getProxyBase());
|
|
780
779
|
const candidates = srcset.split(",").map((c) => c.trim().split(/\s+/)[0]).filter(Boolean);
|
|
@@ -788,7 +787,7 @@ function sanitizeHtml(html) {
|
|
|
788
787
|
css: false,
|
|
789
788
|
// block style attrs entirely for safety
|
|
790
789
|
onTagAttr: (tag, name, value) => {
|
|
791
|
-
const decoded =
|
|
790
|
+
const decoded = decodeEntities(value.trim());
|
|
792
791
|
const decodedLower = decoded.toLowerCase();
|
|
793
792
|
if (name.startsWith("on")) return "";
|
|
794
793
|
if (tag === "img" && name === "src" && !/^https?:\/\//.test(decodedLower)) return "";
|