Skip to:

Opened 3 years ago

Closed 2 years ago

#3251 closed defect (bug) (duplicate)

Minus/hyphen character incorrectly escaped in display name, topic & forum titles

Reported by: antipole Owned by: johnjamesjacoby
Milestone: Priority: normal
Severity: normal Version:
Component: API - Subscriptions Keywords: needs-patch


In the strings returned by bbp_get_topic_author_display_name, bbp_get_topic_title and bbp_get_forum_title, the dash/minus character has been escaped into ampersand#8211, which is the em-dash.

When forums and topics are displayed, this goes unnoticed because the escaped sequence is displayed as an em-dash. But in a plain text email notification it appears as the escape sequence. On my site, all display names contain a dash as do many of the forum names. This makes for very ugly email notifications.

I have tested and found that the endash – emdash — nonbr hyphen ‑ & figure dash ‒ all come through correctly. Only the minus sign gets escaped. I have tested this with bbPress as the only active plugin and TwentyNineteen as the theme and the problem shows. I have also tested it in a WordPress post and there is no problem.

I conclude that this is a bbPress issue and I see no reason why it should be so. It is a bug in bbPress or the underlying filters it calls. I have fixed it up on my site with the following code but this should not be necessary.

function ovni_restore_dash($text){
	return(str_replace("–", "-", $text));
add_filter("bbp_get_topic_author_display_name", "ovni_restore_dash");
add_filter("bbp_get_topic_title", "ovni_restore_dash");
add_filter("bbp_get_forum_title", "ovni_restore_dash");

Change History (3)

#1 @johnjamesjacoby
3 years ago

  • Component changed from General to API - Subscriptions
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 2.6
  • Owner set to johnjamesjacoby

Hey @antipole, thanks for creating this issue. Sorry it's causing you and your issues some grief, but I'll make sure it gets fixed up in the next major release.

The fix will be to un-encode a few more of those types of strings, to make them email safe, than is currently being done.

#2 @antipole
3 years ago

Also need

add_filter("bbp_get_reply_author_display_name", "ovni_restore_dash");

#3 @johnjamesjacoby
2 years ago

  • Milestone 2.6 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Fixed in r6904. See #3256.

Thanks @antipole for creating this ticket. This will be fixed in bbPress 2.6.

Note: See TracTickets for help on using tickets.