note 93004 deleted from function.stripos by danbrown
| From: | danbrown@php.net | Date: | Wed, 29 Jun 2011 18:51:20 +0000 |
| Subject: | note 93004 deleted from function.stripos by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-181068@lists.php.net to get a copy of this message | ||
Note Submitter: vgiralt
----
The mail validator example is NON CONFORMANT with SMTP mail RFCs. Valid characters for Internet
e-mail address are more than the ones listed here. Implementing such lame validator is a big
disservice to the whole Internet.
Those interested can read RFC 5322. In short, the valid characters are different on both sides of
the @ sign, so, before applying this fast technique the address should be exploded into the two side
strings, and then, use different valid character strings for the local-part and the domain.
A local part can be any alphabetic or digit US-ASCII character plus
"!#$%&'*+-/=?^_`{|}~", and then, if it is enclosed in double-quotes ("), it
can be any US-ASCII character except double-quote (") and back-slash(\).
The domain can be any printable US-ASCII characters not including "[", "]", or
"\".
And then, this could be overridden with the advent of internationalized domains, that can use UTF-8
character sets.
Implementation of the validator is left as an exercise for the reader.