From 39accd73db49301362132661cf55592b3cfc35b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Sredojevi=C4=87?= Date: Tue, 14 Jan 2025 20:09:54 +0100 Subject: [PATCH] libs/utils/regexp.ts: accept trailing spaces in name fields Those get trimmed during sanitization --- src/lib/utils/regexp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils/regexp.ts b/src/lib/utils/regexp.ts index fcc8cce..69052d0 100644 --- a/src/lib/utils/regexp.ts +++ b/src/lib/utils/regexp.ts @@ -1,6 +1,6 @@ import { env } from '$env/dynamic/public'; -export const nameRegExp = /^[a-zA-ZčČćĆdžDŽđĐšŠžŽ]+(?:(?:\s|-)[a-zA-ZčČćĆdžDŽđĐšŠžŽ]+)?$/; +export const nameRegExp = /^[a-zA-ZčČćĆdžDŽđĐšŠžŽ]+(?:(?:\s|-)[a-zA-ZčČćĆdžDŽđĐšŠžŽ]+)?\s*$/; export const nameRegExpMsg = 'String must be 1-2 word(s) seperated by space or dash (-)'; export const indexRegExp = new RegExp(