Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed issue #2432 #2437

Merged

Conversation

code0emperor
Copy link
Contributor

@code0emperor code0emperor commented Aug 9, 2024

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
Copy link
Member

rubiin commented Aug 10, 2024

could you also add tests for this specific scenario

@code0emperor
Copy link
Contributor Author

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

@code0emperor
Copy link
Contributor Author

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

Copy link
Member

@rubiin rubiin left a comment

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
Contributor Author

yep, am on it rn

Copy link

codecov bot commented Aug 10, 2024

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
Copy link
Contributor Author

code0emperor commented Aug 10, 2024

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

@profnandaa
Copy link
Member

Thanks for your contrib! 🎉

@profnandaa profnandaa merged commit 283a6a5 into validatorjs:master Aug 15, 2024
10 checks passed
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