-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] check for empty host when calling checkdnsrr() #22109
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
74629a4
[Validator] Allow checkMX() to return false when $host is empty
b7f6db6
Add empty check on host in other methods + add unit tests
af3b0d9
Remove malformed EmailValidatorTest + Update UrlValidator test
fd9843a
fix coding standard to comply with fabbot
61e2439
Use LF line separator
1683fee
Move empty condition in return statement
00f8e7b
Add a test case to prevent future regressions
6a919dd
Remove unnecessary parentheses
628c2d8
Switch to `is_string` native method
794f63d
remove non relevant test case
756f9ce
Switch to `empty` native function to check emptiness
b6f471a
Add a test to prevent future regressions
7defce7
rename dataset provider
c9b4613
cast substr result to string and remove empty function use
67e1dcc
update dataProvider function name
bb05115
move provider after test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Switch to
empty
native function to check emptiness
Switch to `empty` because depending on the PHP version, substr returns '' or false
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid
empty
:) We expect a string, and only a empty string ($host === ''
) should not be passed tocheckdnsrr
.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know but
substr($value, strrpos($value, '@') + 1)
with$value = 'foo@bar.fr@'
returns""
with PHP 7.* andfalse
with PHP 5.6. So only checking for string emptiness is not enough.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's cast the substring result above.
$host = (string) ...;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's done, thank you