mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 05:40:02 -06:00
chore: blacklisted questionIds (#1700)
This commit is contained in:
committed by
GitHub
parent
c35a57d2ca
commit
163732cea0
@@ -162,7 +162,10 @@ const validateHiddenField = (
|
||||
return "Question already exists";
|
||||
}
|
||||
// no key words -- userId & suid & existing question ids
|
||||
if (["userId", "suid"].includes(field) || existingQuestions.findIndex((q) => q.id === field) !== -1) {
|
||||
if (
|
||||
["userId", "source", "suid", "end", "start", "welcomeCard", "hidden"].includes(field) ||
|
||||
existingQuestions.findIndex((q) => q.id === field) !== -1
|
||||
) {
|
||||
return "Question not allowed";
|
||||
}
|
||||
// no spaced words --> should be valid query param on url
|
||||
|
||||
@@ -40,10 +40,10 @@ export default function UpdateQuestionId({
|
||||
updateQuestion(questionIdx, { id: prevValue });
|
||||
toast.error("ID should not be empty.");
|
||||
return;
|
||||
} else if (currentValue === "source" || currentValue === "suID" || currentValue === "userId") {
|
||||
} else if (["userId", "source", "suid", "end", "start", "welcomeCard", "hidden"].includes(currentValue)) {
|
||||
setCurrentValue(prevValue);
|
||||
updateQuestion(questionIdx, { id: prevValue });
|
||||
toast.error("ID cannot used reserved words.");
|
||||
toast.error("Reserved words cannot be used as question ID");
|
||||
return;
|
||||
} else {
|
||||
setIsInputInvalid(false);
|
||||
|
||||
Reference in New Issue
Block a user