feat(dashboard): trim all user-submitted strings

This commit is contained in:
Jake Fulmine 2022-08-22 10:01:07 +02:00
parent adaddb579e
commit 267e85b891
5 changed files with 15 additions and 0 deletions

View File

@ -36,6 +36,9 @@
} }
} }
// trim all string fields
Object.keys(data).forEach(k => data[k] = typeof data[k] == "string" ? data[k].trim() : data[k]);
err = err; err = err;
if (err.length > 0) return; if (err.length > 0) return;

View File

@ -45,6 +45,9 @@
} }
} }
// trim all string fields
Object.keys(data).forEach(k => data[k] = typeof data[k] == "string" ? data[k].trim() : data[k]);
err = err; err = err;
if (err.length > 0) return; if (err.length > 0) return;

View File

@ -60,6 +60,9 @@
} }
} }
// trim all string fields
Object.keys(data).forEach(k => data[k] = typeof data[k] == "string" ? data[k].trim() : data[k]);
err = err; err = err;
if (err.length > 0) return; if (err.length > 0) return;

View File

@ -83,6 +83,9 @@
} }
} }
// trim all string fields
Object.keys(data).forEach(k => data[k] = typeof data[k] == "string" ? data[k].trim() : data[k]);
err = err; err = err;
if (err.length > 0) return; if (err.length > 0) return;

View File

@ -34,6 +34,9 @@
err.push(`"${data.timezone}" is not a valid timezone, check out <a target="_blank" style="color: var(--bs-body-color);" href="https://xske.github.io/tz/">this site</a> to see your current timezone!`); err.push(`"${data.timezone}" is not a valid timezone, check out <a target="_blank" style="color: var(--bs-body-color);" href="https://xske.github.io/tz/">this site</a> to see your current timezone!`);
} */ } */
// trim all string fields
Object.keys(data).forEach(k => data[k] = typeof data[k] == "string" ? data[k].trim() : data[k]);
err = err; err = err;
if (err.length > 0) return; if (err.length > 0) return;