fix: allow [homarr_base] template variables in app href validation
This commit is contained in:
1 file changed
+4
@@ -5,6 +5,10 @@ export const appHrefSchema = z
|
|||||||
.trim()
|
.trim()
|
||||||
.url()
|
.url()
|
||||||
.regex(/^(?!javascript)[a-zA-Z]*:\/\//i) // javascript: is not allowed, i for case insensitive (so Javascript: is also not allowed)
|
.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(""))
|
.or(z.literal(""))
|
||||||
.transform((value) => (value.length === 0 ? null : value))
|
.transform((value) => (value.length === 0 ? null : value))
|
||||||
.nullable();
|
.nullable();
|
||||||
|
|||||||
Reference in new issue
Block a user