validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

fix(isEmail): reject quoted emails with blacklisted characters

Open alokdwivedi103 opened this issue 1 year ago • 5 comments

Fix (email-validation): reject quoted emails with blacklisted characters

Pointed out in issue 2392 - isEmail does not reject emails when blacklisted_chars includes quote. To resolve this issue, the email validation function should be updated to properly enforce the blacklisting of quotes in the user part of the email. This can be achieved by:

  • Modifying the validation logic to check for blacklisted characters specifically in the user part of the email before further processing.
  • Implementing unit tests to cover various scenarios, including those provided above, to ensure that quotes are effectively excluded from valid email addresses.

Checklist

  • [x] PR contains only changes related; no stray files, etc.
  • [ ] README updated (where applicable)
  • [ ] Tests written (where applicable)
  • [x] References provided in PR (where applicable)

alokdwivedi103 avatar Oct 06 '24 12:10 alokdwivedi103

Let’s banish those quote villains from our emails! 🚫💬 Your feedback is gold! 💰

alokdwivedi103 avatar Oct 06 '24 12:10 alokdwivedi103

@alokdwivedi103 Add tests too

rubiin avatar Oct 06 '24 14:10 rubiin

Added tests @rubiin

alokdwivedi103 avatar Oct 06 '24 16:10 alokdwivedi103

@rubiin can you please help me close this pr as it is being pending for 2 weeks Thanks..

alokdwivedi103 avatar Oct 19 '24 09:10 alokdwivedi103

We've merged https://github.com/validatorjs/validator.js/pull/2414 in the past. Why do we need this additional one?

WikiRik avatar Oct 20 '24 17:10 WikiRik