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

Fix logic error in setEmailAddress #740

Merged
merged 2 commits into from
Oct 22, 2018
Merged

Conversation

smrtab
Copy link
Contributor

@smrtab smrtab commented Oct 15, 2018

Fixes #739

Checklist

  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the [Contribution Guide] and my PR follows them.
  • I updated my branch with the master branch.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added in line documentation to the code I modified

Short description of what this PR does:

The next condition on line 73 is wrong (file /mail/EmailAddress.php).
if (!is_string($emailAddress) && filter_var($emailAddress, FILTER_VALIDATE_EMAIL))

It turns out that email address shouldn't be a string and should be a valid address simultaneously in order to throw exception.

Probably the right condition is:
if (!(is_string($emailAddress) && filter_var($emailAddress, FILTER_VALIDATE_EMAIL)))
If you have questions, please send an email to Sendgrid, or file a Github Issue in this repository.

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Oct 15, 2018
@SendGridDX
Copy link

SendGridDX commented Oct 15, 2018

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@peter279k peter279k left a comment

Choose a reason for hiding this comment

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

I also use the similar approach to fix this issue.

@devchas devchas added the status: work in progress Twilio or the community is in the process of implementing label Oct 17, 2018
@thinkingserious thinkingserious added type: bug bug in the library hacktoberfest difficulty: medium fix is medium in difficulty status: ready for deploy code ready to be released in next deploy and removed status: code review request requesting a community code review or review from Twilio status: work in progress Twilio or the community is in the process of implementing labels Oct 22, 2018
@thinkingserious thinkingserious merged commit 77f4c12 into sendgrid:master Oct 22, 2018
@thinkingserious
Copy link
Contributor

Hello @smrtab,

Thanks again for the PR!

It's HACKTOBERFEST! We want to show our appreciation by sending you some special Hacktoberfest swag. If you have not already, could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

@thinkingserious
Copy link
Contributor

Hello @smrtab,

Thanks again for the PR!

We noticed that you have earned 3 out of the 5 points needed to receive glorious SendGrid Hacktoberfest swag.

Please take a moment to checkout this link to find more issues to get you past the required threshold.

Also, please be sure that you have officially registered here.

Thank you and Happy Hacktobering!

Team SendGrid DX

@thinkingserious
Copy link
Contributor

Hello @smrtab,

Thanks again for the PR!

You have earned 3 out of the 5 points needed to receive glorious SendGrid Hacktoberfest swag.

Please take a moment to checkout this link to find more issues to get you past the required threshold or to simply continue the celebration.

Also, please be sure you have officially registered with us here by November 1, 2018 to qualify.

If you have any questions you can email us at [email protected].

Thank you and Happy Hacktobering!

Team SendGrid

@thinkingserious thinkingserious changed the title Fixes #739 Wrong condition Fix logic error in setEmailAddress Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: ready for deploy code ready to be released in next deploy type: bug bug in the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong condition in /mail/EmailAddress.php
6 participants