mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-12-22 19:53:49 +01:00
Harden email split
This commit is contained in:
parent
5901b660de
commit
f03b7a957c
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user