Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 months ago

#57873 closed task (blessed) (fixed)

PHPMailer: Update to v6.8.0

Reported by: ayeshrajans's profile ayeshrajans Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.3 Priority: normal
Severity: normal Version: 6.2
Component: External Libraries Keywords: has-patch add-to-field-guide
Focuses: Cc:

Description (last modified by jrf)

PHPMailer 6.8.0. has just been released. Mostly a bug fix release, though it also contains a new feature (DSN URL parsing).

Full details:

@jrf has reviewed the diff and the changes look sensible to her, so she would recommend an update.

To be decided: should the new src/DSNConfigurator.php file be included in WP or not ?

Previously: #53430, #53953, #54514, #55187, #55277, #55976, #56016, #56413, #56772, #57281

Change History (13)

#2 @jrf
2 years ago

Cricky... just noticed this ticket.... looks like we both opened one only 6 second apart from each other....

https://core.trac.wordpress.org/ticket/57874

@ayeshrajans As you've prepared a patch already, I suggest I close the other ticket, but I think it would be good to add the links from the description in my ticket to this ticket. Do you agree ?

#3 follow-up: @jrf
2 years ago

Also: the Hindi translation has been updated - do we need to ping the Polyglots team to get the translation used by WP updated as well ?

#4 @hellofromTonya
2 years ago

  • Milestone changed from Awaiting Review to 6.3

#5 follow-up: @ayeshrajans
2 years ago

Bleeding-edge PHPMailer :) Thank you.

#57874 has a way better description. I don't think I can edit the original description; I'm happy with however you suggest we proceed. We could copy-paste but perhaps someone with permissions update the ticket?

I took the liberty of deciding to not include the new DSN class because we initialize PHPMailer on our own, use no autoloader, and because we don't include the whole PHPMailer library anyway.

Also: the Hindi translation has been updated - do we need to ping the Polyglots team to get the translation used by WP updated as well ?

From what I see, we catch PHPMailer exceptions and throw a WP_Error with wp_mail_failed, containing the Exception message thrown by PHPMailer. However, we don't use PHPMailer's localization, so the Exception messages would be the same in v6.8.0 too. My guess is that we don't need to bother with the translations, because as far as WordPress is concerned, we don't change any of the source text strings. I don't understand Hindi to know if the updated translations are dramatically different, but pinging them could prove useful.

#6 in reply to: ↑ 5 @jrf
2 years ago

  • Description modified (diff)

Replying to ayeshrajans:

Bleeding-edge PHPMailer :) Thank you.

#57874 has a way better description. I don't think I can edit the original description; I'm happy with however you suggest we proceed. We could copy-paste but perhaps someone with permissions update the ticket?

I have updated the description of this ticket now.

I took the liberty of deciding to not include the new DSN class because we initialize PHPMailer on our own, use no autoloader, and because we don't include the whole PHPMailer library anyway.

That makes perfect sense to me.

Also: the Hindi translation has been updated - do we need to ping the Polyglots team to get the translation used by WP updated as well ?

From what I see, we catch PHPMailer exceptions and throw a WP_Error with wp_mail_failed, containing the Exception message thrown by PHPMailer. However, we don't use PHPMailer's localization, so the Exception messages would be the same in v6.8.0 too. My guess is that we don't need to bother with the translations, because as far as WordPress is concerned, we don't change any of the source text strings. I don't understand Hindi to know if the updated translations are dramatically different, but pinging them could prove useful.

Want to send out a ping in Slack ? There must be a polyglots channel there, I suppose ?

#7 @jrf
2 years ago

#57874 was marked as a duplicate.

#8 in reply to: ↑ 3 @SergeyBiryukov
2 years ago

Replying to jrf:

Also: the Hindi translation has been updated - do we need to ping the Polyglots team to get the translation used by WP updated as well ?

Looking at the two related commits (98a2f2c and 1d330c7), it appears that translations for these strings were added or updated:

$PHPMAILER_LANG = [
    'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' .
        ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' .
        ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.',
    ...
    'invalid_header' => 'Invalid header name or value',
    'invalid_hostentry' => 'Invalid hostentry: ',
    'invalid_host' => 'Invalid host: ',
    ...
    'signing' => 'Signing Error: ',
];

As far as I can tell, most of the strings in the $PHPMAILER_LANG array are debugging messages used when a PHP exception is thrown. These strings are not exposed for translation in WordPress core, nor does it provide its own strings for that purpose, so I don't think these updates are relevant for the Polyglots team.

#9 @jrf
2 years ago

  • Type changed from enhancement to task (blessed)

#10 @SergeyBiryukov
2 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 55557:

External Libraries: Upgrade PHPMailer to version 6.8.0.

This is a maintenance release with a new feature: DSN URL parsing, which allows you to create a PHPMailer instance with most important settings by passing in a single URL, ideal for configuring PHPMailer from an environment variable.

Note: This commit does not include new DSN class, as it is not particularly relevant for WordPress core at this time.

References:

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427], [54937].

Props ayeshrajans, jrf, Synchro.
Fixes #57873.

@SergeyBiryukov commented on PR #4176:


2 years ago
#11

Thanks for the PR! Merged in r55557.

#12 @stevenlinx
23 months ago

  • Keywords add-to-field-guide added

This ticket was mentioned in Slack in #hosting by wesrapyd. View the logs.


2 months ago

Note: See TracTickets for help on using tickets.