Show
Ignore:
Timestamp:
10/23/07 18:28:40 (1 year ago)
Author:
donncha
Message:

Merge with WordPress?, rev 6285 and untested

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-mail.php

    r1069 r1125  
    6161                        } 
    6262 
    63                         // Set the author using the email address (To or Reply-To, the last used) 
     63                        // Set the author using the email address (From or Reply-To, the last used) 
    6464                        // otherwise use the site admin 
    65                         if (preg_match('/From: /', $line) | preg_match('/Reply-To: /', $line))  { 
    66                                 $author=trim($line); 
    67                                 if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) { 
    68                                         $author = $regs[1]; 
     65                        if ( preg_match('/(From|Reply-To): /', $line) )  { 
     66                                if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) 
     67                                        $author = $matches[0]; 
     68                                else 
     69                                        $author = trim($line); 
     70                                $author = sanitize_email($author); 
     71                                if ( is_email($author) ) { 
    6972                                        echo "Author = {$author} <p>"; 
    7073                                        $author = $wpdb->escape($author);