You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The check is passed. As a result, I get an error from an SMTP server that doesn't like this address. Tested on exim4 and mailpit.
# exim4
501 NUL characters are not allowed in SMTP commands
# mailpit
451 4.3.5 Unable to process mail
[smtpd] error parsing message: malformed MIME header line: Received: from [127.0.0.1]
At the same time, the standard validation of the mail address in PHP works correctly:
The filter validator, which uses PHP's filter_var function, ships with Laravel and was Laravel's default email validation behavior prior to Laravel version 5.8.
What was the idea of using a third-party library that performs such a simple task worse than the built-in tools in PHP?
Steps To Reproduce
The description provides example code for tinker.
The text was updated successfully, but these errors were encountered:
Laravel Version
10.16.1
PHP Version
8.1.21
Database Driver & Version
No response
Description
I found that the mail address validation rule skips the null byte in the login.
Here is an example of code that can be executed in tinker:
The check is passed. As a result, I get an error from an SMTP server that doesn't like this address. Tested on exim4 and mailpit.
At the same time, the standard validation of the mail address in PHP works correctly:
$ php -r "var_dump(filter_var(urldecode('exa%00mple%40domain.tld'), FILTER_VALIDATE_EMAIL));" bool(false)
I found a way to solve this problem by adding a
filter
flag to the validation rule.https://laravel.com/docs/10.x/validation#rule-email
What was the idea of using a third-party library that performs such a simple task worse than the built-in tools in PHP?
Steps To Reproduce
The description provides example code for tinker.
The text was updated successfully, but these errors were encountered: