Skip to content
Snippets Groups Projects
Commit ab8608d4 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Fix url validation to disallow spaces

parent 6eeecd1d
Branches
Tags
No related merge requests found
......@@ -15,11 +15,15 @@ import { FunctionFactory } from "survey-core";
function validateWebsiteUrl(params) {
const value = params[0];
const nonEmpty = params[1] || false;
if (!nonEmpty && (value === undefined || value == null)) {
return true;
}
try {
if (value.includes(" ")) {
return false;
}
const url = new URL(value);
return !!url
} catch (err) {
......@@ -221,7 +225,7 @@ function SurveyContainerComponent({ loadFrom }) {
toast("Some fields are invalid, please correct them.");
return;
}
},
'releaseLock': async () => {
const response = await fetch('/api/response/unlock/' + year + '/' + nren, { method: 'POST' });
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment