forked from Respect/Validation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure that "Email" only validates strings
There shouldn't be possible to consider a non-string value as a valid email anyways, but the real problem is that the "RFCValidation" from "egulias/email-validator" casts the input as a string which makes PHP trigger an error. Co-authored-by: Henrique Moody <[email protected]>
- Loading branch information
1 parent
5a067fa
commit c9850f4
Showing
3 changed files
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ | |
|
||
namespace Respect\Validation\Rules; | ||
|
||
use stdClass; | ||
|
||
function class_exists($className) | ||
{ | ||
if (isset($GLOBALS['class_exists'][$className])) { | ||
|
@@ -142,6 +144,10 @@ public function providerForInvalidEmail() | |
['[email protected]'], | ||
['[email protected].'], | ||
['[email protected]'], | ||
[[]], | ||
[new stdClass()], | ||
[null], | ||
[tmpfile()], | ||
]; | ||
} | ||
} |