From d6c7ca5f7095d5ad7ebd68dee4b91f928c279c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Thu, 7 Jul 2022 14:15:56 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20email=20form=20regex=20=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/molecules/EmailForm.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/molecules/EmailForm.svelte b/src/components/molecules/EmailForm.svelte index 174e7a7..a43e6d2 100644 --- a/src/components/molecules/EmailForm.svelte +++ b/src/components/molecules/EmailForm.svelte @@ -32,7 +32,7 @@ const formData = new FormData(target) const email = String(formData.get('email')) - if (email && email.match('/^([\w.-])+@([\w.-])+\.([a-zA-Z])+/')) { + if (email && email.match(/^([\w.-])+@([\w.-])+\.([a-zA-Z])+/)) { const req = await fetch('/api/newsletter', { method: 'POST', headers: { 'Content-Type': 'text/plain' },