Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
The function returns the result of preg_match which returns either an integer (0 or 1) or FALSE if an error occurs.
So there is never TRUE returned, you cannot test like === TRUE.
I'm not sure if this is a documentation problem. In my opinion the function should return the following:
return preg_match("/^$user@($domain|(\[($ipv4|$ipv6)\]))$/", $mail) === 1;
Comments
Comment #1
berliner CreditAttribution: berliner commentedsee:
http://api.drupal.org/api/function/valid_email_address/6
http://php.net/manual/en/function.preg-match.php
Comment #2
jhodgdonThanks for reporting, but this issue has already been reported.
#505730: valid_email_address: wrong return type