fix: allow [homarr_base] template variables in app href validation

This commit is contained in:
Thomas Camlong committed 2026-08-03 16:45:16 +02:00
1 parent 05292ae1f5
commit eaede83f6d
1 file changed
+4
+4
View File
@@ -5,6 +5,10 @@ export const appHrefSchema = z
.trim()
.url()
.regex(/^(?!javascript)[a-zA-Z]*:\/\//i) // javascript: is not allowed, i for case insensitive (so Javascript: is also not allowed)
.or(z.string().trim().includes("[homarr_base]"))
.or(z.string().trim().includes("[homarr_hostname]"))
.or(z.string().trim().includes("[homarr_domain]"))
.or(z.string().trim().includes("[homarr_protocol]"))
.or(z.literal(""))
.transform((value) => (value.length === 0 ? null : value))
.nullable();