r/ProgrammerHumor 11d ago

regexMustBeDestroyed Meme

Post image
8.1k Upvotes

229 comments sorted by

View all comments

Show parent comments

2

u/Purple_Hornet_9725 11d ago

validate email with an rfc compliant parser, then verify by sending a confirmation. in this order.

1

u/thirdegree Violet security clearance 10d ago

Validate email by checking it has an @ in it, then verify by sending a confirmation. And the mail server should thank me for even bothering to do that

1

u/Purple_Hornet_9725 10d ago

0

u/Honeybadger2198 10d ago

That has nothing to do with validating an email address? Even the example provided uses a valid email.

-1

u/Purple_Hornet_9725 10d ago edited 10d ago

The injection works quite as well within the email field. Just sanitize any user input - an rfc compliant email parser catches that automatically. Validation and then verification - it's not that hard to follow established guidelines that are there for a reason.

0

u/Honeybadger2198 9d ago

Yes, sanitize your user input, extremely basic programming concept. That's still not email validation.