[wp-trac] Re: [WordPress Trac] #6904: Blog by email posts blank in 2.5.1 w/ HTML email

WordPress Trac wp-trac at lists.automattic.com
Thu May 15 16:15:38 GMT 2008


#6904: Blog by email posts blank in 2.5.1 w/ HTML email
-----------------------------------+----------------------------------------
 Reporter:  geodanny               |        Owner:  anonymous
     Type:  defect                 |       Status:  new      
 Priority:  high                   |    Milestone:  2.7      
Component:  General                |      Version:  2.5.1    
 Severity:  normal                 |   Resolution:           
 Keywords:  wp-mail.php has-patch  |  
-----------------------------------+----------------------------------------
Changes (by nrackliffe):

  * keywords:  => wp-mail.php has-patch
  * priority:  normal => high

Comment:

 I suspect that the problem lies in this section of wp-mail.php:

 {{{
 139    if ($content_type == 'multipart/alternative') {
 140             $content = explode('--'.$boundary, $content);
 141             $content = $content[2];
 142             $content = explode('Content-Transfer-Encoding: quoted-
 printable', $content);
 143             $content = strip_tags($content[1],
 '<img><p><br><i><b><u><em><strong><strike><font><span><div>');
 }}}

 Gmail sends out HTML mail as a multipart/alternative, however it doesn't
 have the {{{'Content-Transfer-Encoding: quoted-printable'}}} header.  This
 leaves {{{$content[1]}}} empty, which results in a post with a title, but
 no body.

 A different solution is needed to remove the headers from the multipart
 message.  I tried doing the following and it seems to be working, but
 there is probably a better way to detect this.

 {{{
 142             $content = explode('\n\n', $content);
 }}}

 A fix to this section of code will probably help most people that are
 having problems with blank posts coming from email.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6904#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list