BUGFIX: internal url can start with /

This commit is contained in:
Jeroen De Meerleer 2021-12-31 18:22:31 +01:00
parent 95bbe6d9ce
commit 809fae2edd
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -48,4 +48,7 @@ function initExternalLinks() {
})
}
const isExternalURL = (url) => new URL(url).origin !== location.origin;
const isExternalURL = (url) => {
if(url.startsWith('/')) return false;
return new URL(url).origin !== location.origin;
}