Ticket #4775: wp-mail.php.diff

File wp-mail.php.diff, 1.2 KB (added by johnjosephbachir, 5 years ago)
  • wp-mail.php

     
    6464                        // otherwise use the site admin 
    6565                        if (preg_match('/From: /', $line) | preg_match('/Reply-To: /', $line))  { 
    6666                                $author=trim($line); 
    67                         if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) { 
    68                                 $author = $regs[1]; 
    69                                 echo "Author = {$author} <p>"; 
    70                                 $author = $wpdb->escape($author); 
    71                                 $result = $wpdb->get_row("SELECT ID FROM $wpdb->users WHERE user_email='$author' LIMIT 1"); 
    72                                 if (!$result) 
     67                                if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) { 
     68                                        $author = $regs[1]; 
     69                                        echo "Author = {$author} <p>"; 
     70                                        $author = $wpdb->escape($author); 
     71                                        $result = $wpdb->get_row("SELECT ID FROM $wpdb->users WHERE user_email='$author' LIMIT 1"); 
     72                                        if (!$result) 
     73                                                $post_author = 1; 
     74                                        else 
     75                                                $post_author = $result->ID; 
     76                                } else 
    7377                                        $post_author = 1; 
    74                                 else 
    75                                         $post_author = $result->ID; 
    76                         } else 
    77                                 $post_author = 1; 
    7878                        } 
    7979 
    8080                        if (preg_match('/Date: /i', $line)) { // of the form '20 Mar 2002 20:32:37'