The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
make sure blocked terms are escaped properly
Steven Tey66364a826ebe
diff --git a/apps/web/lib/edge-config.ts b/apps/web/lib/edge-config.tsindex ff79e5f413..d2e7a9968c 100644--- a/apps/web/lib/edge-config.ts+++ b/apps/web/lib/edge-config.ts@@ -14,9 +14,14 @@ export const isBlacklistedDomain = async (domain: string) => {}const domainToTest = getDomainWithoutWWW(domain) || domain;if (blacklistedDomains.length === 0) return false;+ const blacklistedTermsRegex = new RegExp(+ blacklistedTerms+ .map((term: string) => term.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))+ .join("|"),+ );return (blacklistedDomains.includes(domainToTest) ||- new RegExp(blacklistedTerms.join("|")).test(domainToTest)+ blacklistedTermsRegex.test(domainToTest));};