Skip to content

Commit

Permalink
fix: supprime les \ en trop
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Dec 11, 2024
1 parent a60e923 commit 73960ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion front/src/helpers/validationEmail.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const validateEmail = (email) => {
// eslint-disable-next-line
const re =
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
return re.test(String(email).toLowerCase())
}
export default validateEmail

3 comments on commit 73960ea

@thom4parisot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si on utilise un champ [type="email"], ça fait la validation. C'est pas suffisant ?

@ggrossetie
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je pense que oui, c'est du code assez ancien qu'on devrait supprimer. J'avais lu quelque part que la plupart des expressions régulières n'acceptent pas l'ensemble des adresses emails valides.

@thom4parisot
Copy link
Member

@thom4parisot thom4parisot commented on 73960ea Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oui, un tld avec des caractères non-ascii ne passerait pas (alors que c'est valide). Consigné dans #1151 👍

Please sign in to comment.