WordPress.org

Make WordPress Core

Ticket #17305: 17305.patch

File 17305.patch, 670 bytes (added by dllh, 2 years ago)

Adds check for "Foo <a@…>" format.

  • wp-includes/pluggable.php

     
    401401 
    402402        foreach ( (array) $to as $recipient ) { 
    403403                try { 
     404                        // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>" 
     405                        $recipient_name = ''; 
     406                        if( preg_match( '/(.+)\s?<(.+)>/', $recipient, $matches ) ) { 
     407                                if ( count( $matches ) == 3 ) { 
     408                                        $recipient_name = $matches[1]; 
     409                                        $recipient = $matches[2]; 
     410                                } 
     411                        } 
    404412                        $phpmailer->AddAddress( trim( $recipient ) ); 
    405413                } catch ( phpmailerException $e ) { 
    406414                        continue;