WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#31708 closed defect (bug) (fixed)

_wp_staticize_emoji_for_email doesn't check for defined key in $mail array.

Reported by: nerrad Owned by: pento
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Emoji Keywords: emoji has-patch
Focuses: Cc:

Description

I think this was added in 4.2 along with the emoji stuff (YAY for emoji!). This function should really be checking for whether the $mail['message'] index in the $mail array exists because other wp_mail hooks may be swapping out 'message' in favor of some other thing they are doing (in which case yes they won't get the emoji's in the content). It just prevents php notices from being thrown and breaking ajax requests using wp_mail when WP_DEBUG is on. In encountered such notice breaking things in my testing.

Attachments (1)

bug.31708.diff (563 bytes) - added by nerrad 6 years ago.
fix for possible unset index for wp_mail array.

Download all attachments as: .zip

Change History (6)

#1 @pento
6 years ago

  • Keywords emoji needs-patch added
  • Milestone changed from Awaiting Review to 4.2

@nerrad
6 years ago

fix for possible unset index for wp_mail array.

#2 @nerrad
6 years ago

  • Keywords has-patch added; needs-patch removed

This ticket was mentioned in Slack in #core by nerrad. View the logs.


6 years ago

#4 @pento
6 years ago

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

In 31847:

When converting emoji in email to static images, check that the message is defined, otherwise we could cause PHP warnings.

Props nerrad.

Fixes #31708.

#5 @pento
5 years ago

  • Component changed from Mail to Emoji
Note: See TracTickets for help on using tickets.