php-src
php-src copied to clipboard
FILTER_VALIDATE_EMAIL allows &
Description
The following code:
$email = "EAS&[email protected]";
if (filter_var($email, FILTER_VALIDATE_EMAIL)) { echo("$email is a valid email address"); } else { echo("$email is not a valid email address"); }
Resulted in this output: EAS&[email protected] is a valid email address
But I expected this output instead: is not a valid email address
PHP Version
PHP 8.0.9
Operating System
Windows
Ampersands are technically valid.
Ok, thank you, it may be technically valid but not practically valid. weird.