diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2021-02-11 19:51:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-11 19:51:06 +0100 |
commit | 37199c1da0c8fafd27e9fd5e6eddbb9e1d295cf0 (patch) | |
tree | 5b11a90535de59be8c0c132fa171729496100f22 /lib | |
parent | 5babad4f6fb983709e7851bb5cea4bc0d2c7fe4c (diff) | |
parent | 883848b58a50b03702eab58f67ca577037fcedab (diff) | |
download | nextcloud-server-37199c1da0c8fafd27e9fd5e6eddbb9e1d295cf0.tar.gz nextcloud-server-37199c1da0c8fafd27e9fd5e6eddbb9e1d295cf0.zip |
Merge pull request #25585 from nextcloud/enhancement/empty-email-validation
Micro-optimize validation of empty email addresses
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Mail/Mailer.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index f8dc739428a..2e996dea502 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -221,6 +221,10 @@ class Mailer implements IMailer { * @return bool True if the mail address is valid, false otherwise */ public function validateMailAddress(string $email): bool { + if ($email === '') { + // Shortcut: empty addresses are never valid + return false; + } $validator = new EmailValidator(); $validation = new RFCValidation(); |