Fixes #893 – Allow links to different subdomains on same domain as wiki

This commit is contained in:
Tom Moor
2019-02-09 16:17:54 +07:00
parent 721332e87a
commit 188f70b676

View File

@@ -4,11 +4,12 @@ import { parseDomain } from '../../shared/utils/domains';
export default function isInternalUrl(href: string) {
if (href[0] === '/') return true;
const outline = parseDomain(BASE_URL);
const outline = parseDomain(window.location.href);
const parsed = parseDomain(href);
if (
parsed &&
outline &&
parsed.subdomain === outline.subdomain &&
parsed.domain === outline.domain &&
parsed.tld === outline.tld
) {