From 809fae2eddd6c96222fa1d89c1fccfcf033fce9c Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Fri, 31 Dec 2021 18:22:31 +0100 Subject: [PATCH] BUGFIX: internal url can start with / --- assets/js/page.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/js/page.js b/assets/js/page.js index e5772d2..2b35e4a 100644 --- a/assets/js/page.js +++ b/assets/js/page.js @@ -48,4 +48,7 @@ function initExternalLinks() { }) } -const isExternalURL = (url) => new URL(url).origin !== location.origin; \ No newline at end of file +const isExternalURL = (url) => { + if(url.startsWith('/')) return false; + return new URL(url).origin !== location.origin; +} \ No newline at end of file