[wp-trac] [WordPress Trac] #28909: Update PHPMailer to 5.2.10

WordPress Trac noreply at wordpress.org
Tue Jul 7 11:01:11 UTC 2015

#28909: Update PHPMailer to 5.2.10
 Reporter:  MattyRob                |       Owner:  ocean90
     Type:  task (blessed)          |      Status:  assigned
 Priority:  normal                  |   Milestone:  4.3
Component:  External Libraries      |     Version:  4.0
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:

Comment (by dd32):

 The reason for the unit test failures is that `PHPMailer::createBody()`
 will set `$this->encoding = 'quoted-printable'` (away from it's default of
 `8bit`) when it encounters a line longer than 999 characters.
 It doesn't look like PHPMailer cleans up after itself / presets all
 variables, that one included, which is causing the problem (so it doesn't
 start with a clean slate each time). It does however override many
 variables on each mail being sent, which is why it probably doesn't have a
 reset-everything-to-default routine that I can see.

 I thought Globals were backed up / restored during each test iteration,
 which would've avoided this, but it doesn't seem like it does.

 [attachment:28909.unit-test-vars.diff 28909.unit-test-vars.diff] works
 around the issue in PHPMailer by setting the Encoding variable in
 preSend(), which appears to fix it.. but I don't know what kind of side
 effects it has.
 It also shows re-creating the `$phpmailer` global on each test iteration,
 a unit test that does nothing other than trigger this bug, and rewrites
 MockMailer to override `postSend()` instead of `send()` for no other
 reason than I did it while diagnosing what was going on.

Ticket URL: <https://core.trac.wordpress.org/ticket/28909#comment:47>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list