Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow choice of email validation method
Following implementation of 50d235a the validation of email addresses was done by PHPMailer::validateAddress() instead of filter_var() with FILTER_SANITIZE_EMAIL to allow RFC5322- compliant emails like 'user@domain' that are rejected by PHP's method which only accepts 'user@domain.tld'. However, these 'top-level-domain-only' addresses are often considered as invalid by SMTP servers but there is a strong use-case for them in intranet environments. To enable both scenarios, this commit introduces new constants for $g_validate_email, allowing the admin to pick whether they want validation using the PHP method (default) or strict RFC5322. Backwards compatibility is maintained because EMAIL_VALIDATE_PHP == ON, and validation can still be disabled with OFF.
- Loading branch information
Showing
4 changed files
with
86 additions
and
6 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
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