From 9a838510f34cefe17e99144ddccaff7668611c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=A9o=20M=C3=A9vollon?= Date: Wed, 20 Dec 2023 13:29:49 +0100 Subject: [PATCH] fix: sanitize user names --- src/utils/sluggify-string.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/sluggify-string.ts b/src/utils/sluggify-string.ts index 98dff779..c9455c36 100644 --- a/src/utils/sluggify-string.ts +++ b/src/utils/sluggify-string.ts @@ -3,7 +3,7 @@ const sluggifyString = (input: string) => .normalize("NFKD") // break down characters and diacritics .replace(/\p{Diacritic}/gu, "") // remove diacritics .replace(/\s+/g, "-") // remove whitespaces - .replace(/'+/g, "") + .replace(/[^a-zA-Z-]/g, "") // remove everything else .toLowerCase() export default sluggifyString