From ffebf1e68990430e1e69dbde9ee25adb06f43c28 Mon Sep 17 00:00:00 2001 From: Slugalisk Date: Sat, 2 Dec 2023 16:54:51 -0800 Subject: [PATCH] fix url sanitization --- assets/chat/js/formatters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/chat/js/formatters.js b/assets/chat/js/formatters.js index 93ec9d0b..2bc28f14 100644 --- a/assets/chat/js/formatters.js +++ b/assets/chat/js/formatters.js @@ -715,7 +715,7 @@ class UrlFormatter { url = self.encodeUrl(tm[0]); const href = scheme + url; if (tm) { - const embedHref = `${NITTER_URL}/${tm[1]}`; + const embedHref = `${NITTER_URL}/${self.encodeUrl(tm[1])}`; return `${embedHref}`; } } @@ -737,7 +737,7 @@ class UrlFormatter { const sub = this.embedSubstitutions[i]; const sm = decodedUrl.match(sub.pattern); if (sm) { - const embed = sub.template(sm[1]); + const embed = self.encodeUrl(sub.template(sm[1])); const embedHref = `${RUSTLA_URL}/${embed}`; return `${embed}`; }