better empty regex

This commit is contained in:
b1ek 2023-03-18 13:14:58 +10:00
parent 3b87f14199
commit da94c1e6f6
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ async function submit(req, res, next) {
if (message.length >= 512) {
errors.push('Maximum length is 512 characters.');
}
if (name.match(/^\s*$/g)) {
if (name.match(/^(\s|\u00A0|[\u2000-\u2009]|\u200A|\u2028|\u205F|\u3000)*$/g)) {
errors.push('Name must be specified.');
}
if (