Skip to:

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3256 closed defect (bug) (fixed)

Topic or reply author name isn't correctly decoded in email notifications

Reported by: danielbachhuber's profile danielbachhuber Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: API - Subscriptions Keywords: has-patch


If my user's display name is Super&AwesomeDaniel (on the frontend, or Super&AwesomeDaniel in the database), then a forum or topic email notification be sent with:

Super&AwesomeDaniel wrote:

I would expect it to display:

Super&AwesomeDaniel wrote:

My hacky workaround is:

add_filter( 'bbp_subscription_mail_message', function( $message ){
	$bits    = explode( PHP_EOL, $message );
	$bits[0] = html_entity_decode( $bits[0], ENT_QUOTES );
	$message = implode( PHP_EOL, $bits );
	return $message;

Attachments (1)

3256.patch (2.1 KB) - added by johnjamesjacoby 5 years ago.
Try wp_specialchars_decode() on author names

Download all attachments as: .zip

Change History (5)

5 years ago

Try wp_specialchars_decode() on author names

#1 @johnjamesjacoby
5 years ago

  • Component changed from General to API - Subscriptions
  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 2.6
  • Owner set to johnjamesjacoby
  • Status changed from new to assigned

#2 @danielbachhuber
5 years ago

@johnjamesjacoby Yep, wp_specialchars_decode() seems to work too.

#3 @johnjamesjacoby
5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 6904:

Subscriptions: ensure special characters in author names are encoded properly.

This commit copies the approach used on the content, and applies wp_specialchars_decode() and strip_tags() to author names in subscription emails.

(HTML tags are not usually allowed in usernames, but we strip them anyways in the event a filter allowed them. Better to keep emails legible than include unintended tags?)

Fixes #3256.

#4 @johnjamesjacoby
5 years ago

#3251 was marked as a duplicate.

Note: See TracTickets for help on using tickets.