note 112492 added to function.filter-var
| From: | gt at kani dot hu | Date: | Fri, 21 Jun 2013 14:31:47 +0000 |
| Subject: | note 112492 added to function.filter-var | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195318@lists.php.net to get a copy of this message | ||
I found some addresses that FILTER_VALIDATE_EMAIL rejects, but RFC5321 permits:
<?php
foreach (array(
'localpart.ending.with.dot.@example.com',
'(comment)localpart@example.com',
'"this is v@lid!"@example.com',
'"much.more unusual"@example.com',
'postbox@com',
'admin@mailserver1',
'"()<>[]:,;@\\"\\\\!#$%&\'*+-/=?^_`{}| ~.a"@example.org',
'" "@example.org',
) as $address) {
echo "<p>$address is <b>".(filter_var($address, FILTER_VALIDATE_EMAIL) ?
'' : 'not')." valid</b></p>";
}
?>
Results:
localpart.ending.with.dot.@example.com is not valid
(comment)localpart@example.com is not valid
"this is v@lid!"@example.com is not valid
"much.more unusual"@example.com is not valid
postbox@com is not valid
admin@mailserver1 is not valid
"()<>[]:,;@\"\\!#$%&'*+-/=?^_`{}| ~.a"@example.org is not valid
" "@example.org is not valid
The documentation does not saying that FILTER_VALIDATE_EMAIL should pass the RFC5321, however you
can meet with these examples (especially with the first one). So this is a note, not a bug report.
----
Server IP: 69.147.83.199
Probable Submitter: 94.21.228.238
----
Manual Page -- http://php.net/manual/en/function.filter-var.php
Edit -- https://master.php.net/note/edit/112492
Del: integrated -- https://master.php.net/note/delete/112492/integrated
Del: useless -- https://master.php.net/note/delete/112492/useless
Del: bad code -- https://master.php.net/note/delete/112492/bad+code
Del: spam -- https://master.php.net/note/delete/112492/spam
Del: non-english -- https://master.php.net/note/delete/112492/non-english
Del: in docs -- https://master.php.net/note/delete/112492/in+docs
Del: other reasons-- https://master.php.net/note/delete/112492
Reject -- https://master.php.net/note/reject/112492
Search -- https://master.php.net/manage/user-notes.php