[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
Sat May 31 03:14:39 GMT 2008


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

  * status:  reopened => closed
  * resolution:  => worksforme

Comment:

 This helped me get my issues fixed with a couple of caveats.  If multiple
 messages are waiting to be processed, the `rheaders` function gets
 redeclared.  I moved the function outside the message loop and fixed that
 problem.

 Also, the line following the call to `rheaders` needs to be changed
 because `rheaders` returns a single string and not an array.  Here's what
 worked for me;  I took the original `strip_tags` line:

 {{{
   $content =
 strip_tags($content[1],'<img><p><br><i><b><u><em><strong><strike><font><span><div>');
 }}}

 and changed it to:

 {{{
   $content = strip_tags($content,
 '<img><p><br><i><b><u><em><strong><strike><font><span><div>');
 }}}

 I did need to add the following line to the headers array in order to
 handle Gmail's rich formatting.

 {{{
   "/Content\-Type\: text\/html\; charset\=ISO\-8859\-1/i",
 }}}

 AOL mail comes in with yet another encoding, which I think can be fixed by
 adding:

 {{{
   "/Content\-Type\: text\/html\; charset\=us\"\-ascii\"/i",
 }}}

 I suppose a more robust regexp would be helpful here; something that
 accepts text\html regardless of the encoding.  I think there is a newline
 that could be matched at the end of the line, but I'm not sure how to go
 about that in PHP.

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


More information about the wp-trac mailing list