[wp-trac] [WordPress Trac] #30266: wp_mail() can send emails with a blank 'From' address

WordPress Trac noreply at wordpress.org
Thu Nov 6 02:43:10 UTC 2014


#30266: wp_mail() can send emails with a blank 'From' address
--------------------------+-----------------------------
 Reporter:  drtonyb       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Mail          |    Version:  4.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 If wp_mail() is used to send an email with a blank 'From' address set, it
 is not detected and replaced with the default wordpress at mydomainname...

 Problem as I see it is in wp-includes/pluggable.php, where line 366
 contains the test

 {{{
         if ( !isset( $from_email ) ) {

 }}}

 The test using isset does not detect an empty string, allowing a blank
 'from' address to be sent. Wouldn't it be better to test using empty?


 {{{
         if ( empty( $from_email ) ) {
 }}}


 The same issue affects the 'from name' test on line 356.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30266>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list