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

buddypress-trac noreply at wordpress.org
Mon Mar 21 17:36:27 UTC 2016


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

 * owner:   => djpaul
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"10670"]:
 {{{
 #!CommitTicketReference repository="" revision="10670"
 Emails: fix fatal errors when sending emails with old versions of
 WordPress (<4.3).

 An upstream change in WordPress #WP25560 updated the version of
 PHPMailer bundled with WordPress, from version 5.2.4 to 5.2.7. Prior to
 that change, it was also impossible to use PHPMailer directly (outside
 of `wp_mail()`) due to how PHPMailer was/is bundled with WordPress. The
 PHPMailer change that concerns us is in `PHPMailer->html2text()`. A
 parameter to use "advanced HTML-to-text conversion" was a bool, but in
 the later version, it was changed to a callable parameter.

 All of the above, combined with PHP's handling of truthy variables,
 meant we were triggering the PHPMailer bug, responsible for the fatal
 errors, on sites running old version of WordPress.

 Fortunately, the fix is simple. We can remove our custom HTML-to-text
 conversion parameter as it doesn't actually matter because we always
 explicitly set the plain text version of the email content, after
 PHPMailer runs its built-in HTML-to-text conversion function,
 regardless of whether BuddyPress sends emails in plain text or HTML.

 Fixes #6970
 }}}

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


More information about the buddypress-trac mailing list