Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

disallow .php in short links

Steven Tey5cd72465020e
diff --git a/apps/web/lib/api/links/utils/process-key.ts b/apps/web/lib/api/links/utils/process-key.ts
index a2a40a8881..72e6e3984b 100644
--- a/apps/web/lib/api/links/utils/process-key.ts
+++ b/apps/web/lib/api/links/utils/process-key.ts
@@ -14,6 +14,11 @@ export function processKey({ domain, key }: { domain: string; key: string }) {
return null;
}
+ // if key ends with .php, return null (we don't support .php in links)
+ if (key.endsWith(".php")) {
+ return null;
+ }
+
// remove all leading and trailing slashes from key
key = key.replace(/^\/+|\/+$/g, "");
/*