Compare commits

...

2 Commits

Author SHA256 Message Date
WlodekM
490c1cc724 fix error when accessing from localhost 2026-01-08 13:19:55 +02:00
WlodekM
ef9f6ba9c7 satanize ampersand 2026-01-08 13:18:03 +02:00

View File

@@ -53,7 +53,7 @@ function verifyToken(token) {
return split[0]; return split[0];
} }
function sanitiseStringHTML(str) { function sanitiseStringHTML(str) {
return str.replaceAll(">", "&gt;").replaceAll("<", "&lt;"); return str.replaceAll("&", "&amp;").replaceAll(">", "&gt;").replaceAll("<", "&lt;");
} }
app.use(express.urlencoded()); app.use(express.urlencoded());
@@ -78,6 +78,7 @@ app.use((req, res, next) => {
const geo = geoip.lookup(req.headers['x-forwarded-for']); const geo = geoip.lookup(req.headers['x-forwarded-for']);
console.log(geo); console.log(geo);
if (geo)
if (geo.country !== "US") if (geo.country !== "US")
if (geo.country !== "UA") if (geo.country !== "UA")
if (geo.country !== "PL") { if (geo.country !== "PL") {