fix(editor): Validate user info before submiting (#7608)
Validate first and last names before saving them to database. This should prevent security issue with un-sanitized data that ends up in emails. --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
committed by
GitHub
parent
9b4856e7de
commit
2064f7f251
@@ -11,7 +11,7 @@ export function NoXss() {
|
||||
options: { message: `Malicious ${propertyName}` },
|
||||
validator: {
|
||||
validate(value: string) {
|
||||
return !/<(\s*)?(script|a|http)/.test(value);
|
||||
return !/(^http|^www)|<(\s*)?(script|a)|(\.[\p{L}\d-]+)/u.test(value);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user