[buddypress-trac] [BuddyPress Trac] #6970: Email API causes fatal error on WP <= v4.2.6

buddypress-trac noreply at wordpress.org
Sun Mar 20 10:31:47 UTC 2016


#6970: Email API causes fatal error on WP <= v4.2.6
--------------------------+--------------------
 Reporter:  DJPaul        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  high          |   Milestone:  2.5.2
Component:  API - Emails  |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by DJPaul):

 We're using `$phpmailer->msgHTML()` to set `Body` and `AltBody`
 properties. `AltBody` is what is set to the end result of this
 `html2text()` call.

 The default escaping for `AltBody` looks like

 {{{
 html_entity_decode(
 trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si',
 '', $html))),
         ENT_QUOTES,
         $this->CharSet
 );
 }}}

 ...which looks vastly insufficient.

 What I suggest is only set the aforementioned toggle to
 `wp_strip_all_tags` only if on WP >= 4.3, and otherwise, after the
 `msgHTML`, explicitly set the `AltBody` property to
 `$this->normalizeBreaks( wp_strip_all_tags( $message ) );`.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6970#comment:3>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list