impr(server): disallow dots in tags, presets and custom theme names

This commit is contained in:
Miodec 2024-07-03 17:34:29 +02:00
parent dd4943bae0
commit 8c00315c5b
2 changed files with 3 additions and 3 deletions

View file

@ -11,7 +11,7 @@ const router = Router();
const presetNameSchema = joi
.string()
.required()
.regex(/^[0-9a-zA-Z_.-]+$/)
.regex(/^[0-9a-zA-Z_-]+$/)
.max(16)
.messages({
"string.pattern.base": "Invalid preset name",

View file

@ -18,7 +18,7 @@ const router = Router();
const tagNameValidation = joi
.string()
.required()
.regex(/^[0-9a-zA-Z_.-]+$/)
.regex(/^[0-9a-zA-Z_-]+$/)
.max(16)
.messages({
"string.pattern.base":
@ -29,7 +29,7 @@ const tagNameValidation = joi
const customThemeNameValidation = joi
.string()
.max(16)
.regex(/^[0-9a-zA-Z_.-]+$/)
.regex(/^[0-9a-zA-Z_-]+$/)
.required()
.messages({
"string.max": "The name must not exceed 16 characters",