Skip to:
Content

bbPress.org

Opened 7 months ago

Closed 7 months ago

Last modified 5 weeks ago

#3256 closed defect (fixed)

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

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

Description

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 7 months ago.
Try wp_specialchars_decode() on author names

Download all attachments as: .zip

Change History (5)

@johnjamesjacoby
7 months ago

Try wp_specialchars_decode() on author names

#1 @johnjamesjacoby
7 months 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
7 months ago

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

#3 @johnjamesjacoby
7 months 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 weeks ago

#3251 was marked as a duplicate.

Note: See TracTickets for help on using tickets.