Skip to content

Commit

Permalink
chore: you saw nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Nov 24, 2024
1 parent 3906ae8 commit 03f48a6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion frontend/src/composables/useMarked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ const renderer = {
}
},
link({ href, title, tokens }) {
console.log("link", href, title, tokens, linkout(href));
return `<a href="${linkout(href)}"` + (title ? ` title="${title}">` : ">") + this.parser?.parseInline(tokens) + "DUM</a>";
},
} satisfies Partial<Renderer>;
Expand Down
7 changes: 0 additions & 7 deletions frontend/src/composables/useUrlHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,24 @@ const isSafeHost = (host: string) => {
};

const isSafe = (urlString: string) => {
console.log("safe?", urlString, useBackendData.security.safeDownloadHosts);
if (!urlString) {
console.log("1");
return false;
}
if (urlString.startsWith("#") || urlString.startsWith("/")) {
console.log("2");
return true;
}
try {
const url = new URL(urlString);
const host = url.hostname;
if (url.protocol?.startsWith("mailto")) {
console.log("3");
return true;
} else if (!host || isSafeHost(host)) {
console.log("4");
return true;
}
} catch {
console.log("5");
return false;
}

console.log("6");
return false;
};

Expand Down

0 comments on commit 03f48a6

Please sign in to comment.