Skip to:

Opened 9 years ago

Closed 7 years ago

#2865 closed defect (bug) (fixed)

Emails for notifications converting characters

Reported by: robkk's profile Robkk Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6 Priority: high
Severity: normal Version: 2.5.8
Component: API - Subscriptions Keywords: has-patch dev-feedback


A user posted a solution to this in the forums, but only for subject lines. This is somewhat his reply was to the topic.

GoTo: yoursite\wp-content\plugins\bbpress\includes\common\functions.php

Between Lines 1090 and 1091 Add:

$search_bbpress_titles = array("&# 039;", "&am p;", "&#82 11;", "&qu ot;"); // ' & - "
$topic_title = str_replace($search_bbpress_titles, '', $topic_title);

Then add the same two lines further down between Lines 1233 and 1234.

NOTE: You will have to remove the spaces from the $search_bbpress_titles array line as I was unable to post without it parsing that line. Don't know the coding on this form to post properly. Email me if you need the code.

Sorry I am a bit lazy now, so just copying and pasting from this reply

Attachments (1)

2865.01.patch (2.0 KB) - added by thebrandonallen 9 years ago.

Download all attachments as: .zip

Change History (6)

#1 @thebrandonallen
9 years ago

  • Keywords has-patch dev-feedback added; needs-patch removed
  • Milestone changed from Awaiting Review to Under Consideration

The issue here is wptexturize which is added, by filter, to the_title. For the bbp_get_(forum|topic|reply)_content functions, we remove all filters from the_content, and add them to their respective bbp_get_(forum|topic|reply)_content filters. However, the_title and bbp_get_(forum|topic|reply)_title filters don't get the same treatment, so removing all filters from bbp_get_(forum|topic|reply)_title has no effect. I'm attaching a patch to fix this, but I'm not sure it's the way we want to go.

The big question is, should the bbp_get_(forum|topic|reply)_title functions be treated the same as the bbp_get_(forum|topic|reply)_content functions by shifting their default filters onto ours?

I've also added wp_specialchars_decode to convert any entities that were added by the user, since plaintext emails don't decode these.

#2 @fliz
8 years ago

In case it helps anybody, I've reworked this patch from @thebrandonallen as a plugin for bbPress 2.5.8:

This should help to fix problems with HTML entities in notification emails on vanilla bbPress installs. It's intended as a workaround until the issue gets fixed in bbPress core.


#3 @Robin Labadie
8 years ago

  • Priority changed from normal to high

I can confirm this happens in mail title when the forum contains double quotes as well. This is pretty ugly, and shouldn't last for such a huge & popular plugin ! That really don't help people clicking notification emails.

See the screenshot

I'd be very grateful if you could fix it natively instead of requiring a plugin/patch to install manually !
Thanks :)

#4 @johnjamesjacoby
7 years ago

  • Milestone changed from Under Consideration to 2.6
  • Owner set to johnjamesjacoby

#5 @johnjamesjacoby
7 years ago

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

In 6613:

Subscriptions: Strip & decode email titles.

Props thebrandonallen. Fixes #2865.

Note: See TracTickets for help on using tickets.