mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
fix: hostname regex (#4255)
This commit is contained in:
@@ -1041,7 +1041,7 @@ export const ZSurvey = z
|
||||
|
||||
if (question.type === TSurveyQuestionTypeEnum.Cal) {
|
||||
if (question.calHost !== undefined) {
|
||||
const hostnameRegex = /^[a-zA-Z0-9]+(?<domain>\.[a-zA-Z0-9]+)+$/;
|
||||
const hostnameRegex = /^(?!-)[a-zA-Z0-9-]{1,63}(?<!-)(?:\.(?!-)[a-zA-Z0-9-]{1,63}(?<!-)){1,}$/i;
|
||||
if (!hostnameRegex.test(question.calHost)) {
|
||||
ctx.addIssue({
|
||||
code: z.ZodIssueCode.custom,
|
||||
|
||||
Reference in New Issue
Block a user