Skip to content

fixed issue #2432#2437

Merged
profnandaa merged 5 commits into
validatorjs:masterfrom
code0emperor:code0emperor-quote-email-fix
Aug 15, 2024
Merged

fixed issue #2432#2437
profnandaa merged 5 commits into
validatorjs:masterfrom
code0emperor:code0emperor-quote-email-fix

Conversation

@code0emperor

@code0emperor code0emperor commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

an email of the type "example*@gmail.com was accepted due to an errant if statement in isEmail.js file which was only checking for the first double quote (user[0] === '"'). Fixed it by adding a secondary "and" condition along with it, to ensure the local part is completely enclosed in the double quotes (&& user[user.length - 1] === '"').

Checklist

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

@rubiin

rubiin commented Aug 10, 2024

Copy link
Copy Markdown
Member

could you also add tests for this specific scenario

@code0emperor

Copy link
Copy Markdown
Contributor Author

In which file should I add them? I wasn't sure of that

@code0emperor

Copy link
Copy Markdown
Contributor Author

added few tests for this issue in validators.test.js

@rubiin rubiin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the tests seems to be failing do fix

@code0emperor

Copy link
Copy Markdown
Contributor Author

yep, am on it rn

@codecov

codecov Bot commented Aug 10, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (f81d857) to head (1250755).
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##            master    #2437      +/-   ##
===========================================
- Coverage   100.00%   99.96%   -0.04%     
===========================================
  Files          110      111       +1     
  Lines         2510     2517       +7     
  Branches       633      634       +1     
===========================================
+ Hits          2510     2516       +6     
- Partials         0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@code0emperor

code0emperor commented Aug 10, 2024

Copy link
Copy Markdown
Contributor Author

Done, i put the test in the wrong area, please check now

@profnandaa

Copy link
Copy Markdown
Member

Thanks for your contrib! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants