Directory traversal fix. I don't think it could've led to something

serious, but lets fix it anyway.
This commit is contained in:
lordtet 2026-04-03 22:13:58 -04:00
parent 750f7fa50a
commit 20c8e3a2cb

View file

@ -90,6 +90,7 @@
var type = hash.slice(0, slash);
var slug = hash.slice(slash + 1);
if (!slug || (type !== "blog" && type !== "projects")) return;
if (!/^[a-z0-9_-]+$/i.test(slug)) return;
var fragUrl = "/fragments/" + type + "/" + slug + "/";
WM.showAt("win-" + type, fragUrl, "/fragments/" + type + "/", function (c) {
injectShare(c, fragUrl);