diff --git a/src/core/Schemas.ts b/src/core/Schemas.ts index 38ffa59fb..fc5d6fbf9 100644 --- a/src/core/Schemas.ts +++ b/src/core/Schemas.ts @@ -125,12 +125,9 @@ const GameConfigSchema = z.object({ const SafeString = z .string() - // Remove common dangerous characters and patterns - // The weird \u stuff is to allow emojis .regex( - /^[a-zA-Z0-9\s.,!?@#$%&*()-_+=\[\]{}|;:"'\/\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]|üÜ]+$/, + /^([a-zA-Z0-9\s.,!?@#$%&*()-_+=\[\]{}|;:"'\/\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]|üÜ])*$/, ) - // Reasonable max length to prevent DOS .max(1000); const EmojiSchema = z.string().refine(