Ignore:
Timestamp:
Jun 14, 2009 10:36:48 AM (15 years ago)
Author:
quinn
Message:

updated tests to work. updated email validation regex to include quote marks around name part. changed logmsg tmp dir name to use script_filename.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Email.inc.php

    r347 r357  
    6969    {
    7070        // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatenation . dot.
    71         // This matches an email address as complex as:
    72         //      Bob John-Smith <bob&smith's/dep=sales!@smith-wick.ca.us> (Sales department)
     71        // This matches a (valid) email address as complex as:
     72        //      "Jane & Bob Smith" <bob&smith's/dep=sales!@smith-wick.ca.us> (Sales department)
    7373        // ...and something as simple as:
    7474        //      x@x.com
    75         $this->setParam(array('regex' => '/^(?:[^,@]*(<)|[^,@]*\s+|)'   // Display name
    76         . '((?:[^.<>\s@",\[\]]+[^<>\s@",\[\]])*[^.<>\s@",\[\]]+)'    // Local-part
     75        $this->setParam(array('regex' => '/^(?:(?:"[^"]*?"\s*|[^,@]*)(<)|(?:"[^"]*?"|[^,@]*)\s+|)'   // Display name
     76        . '((?:[^.<>\s@",\[\]]+[^<>\s@",\[\]])*[^.<>\s@",\[\]]+)'       // Local-part
    7777        . '@'                                                           // @
    7878        . '((?:(\[)|[A-Z0-9]?)'                                         // Domain, first char
Note: See TracChangeset for help on using the changeset viewer.