From 16cc1e48ef469ef8d3596015d29b3f62a03420cc Mon Sep 17 00:00:00 2001 From: Alexander Skvortsov Date: Wed, 7 Oct 2020 15:33:57 -0400 Subject: [PATCH] Restore stricter email validation In v5.8, Laravel expanded email validation logic to closer match the RFC. This, however, allows emails that aren't conventional (for example, emails lacking a TLD). This commit changes Flarum's UserValidator to use the `email:filter` validator, which uses PHP's filter_var, and is the pre-5.8 behavior. See https://laravel.com/docs/5.8/validation#rule-email --- framework/core/src/User/UserValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/core/src/User/UserValidator.php b/framework/core/src/User/UserValidator.php index 6ba88bb7b..ea9624cbc 100644 --- a/framework/core/src/User/UserValidator.php +++ b/framework/core/src/User/UserValidator.php @@ -51,7 +51,7 @@ class UserValidator extends AbstractValidator ], 'email' => [ 'required', - 'email', + 'email:filter', 'unique:users,email'.$idSuffix ], 'password' => [