Harden email split

This commit is contained in:
Paulo Gustavo Veiga 2022-03-31 16:24:00 -03:00
parent 5901b660de
commit f03b7a957c

View File

@ -114,7 +114,11 @@ const ShareDialog = ({ mapId, onClose }: SimpleDialogProps): React.ReactElement
};
// very basic email validation, just make sure the basic syntax is fine
const isValid = model.emails.split(',').every(str => /\S+@\S+\.\S+/.test((str || '').trim()));
const isValid = model.emails
.split(/,|;/)
.filter(e => e.trim().length > 0)
.every(str => /\S+@\S+\.\S+/.test((str || '')
.trim()));
return (
<div>