A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix: Only consider text as URL in editor card if it has an http protocol. Fixes #86
MohamedBassembc6ee2edc9f1
diff --git a/apps/web/components/dashboard/bookmarks/EditorCard.tsx b/apps/web/components/dashboard/bookmarks/EditorCard.tsxindex 28686e6c..6858255a 100644--- a/apps/web/components/dashboard/bookmarks/EditorCard.tsx+++ b/apps/web/components/dashboard/bookmarks/EditorCard.tsx@@ -67,7 +67,10 @@ export default function EditorCard({ className }: { className?: string }) {const onSubmit: SubmitHandler<z.infer<typeof formSchema>> = (data) => {const text = data.text.trim();try {- new URL(text);+ const url = new URL(text);+ if (url.protocol != "http:" && url.protocol != "https:") {+ throw new Error("Invalid URL");+ }mutate({ type: "link", url: text });} catch (e) {// Not a URL