Skip to:
Content

bbPress.org

Opened 5 months ago

Last modified 5 months ago

#3251 new defect

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

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

Description

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 (2)

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

Also need

add_filter("bbp_get_reply_author_display_name", "ovni_restore_dash");
Note: See TracTickets for help on using tickets.