Commit fbc076c9 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1520011: Notifications displaying incorrectly

If we have special chars like " or > in a feedback message they get
saved to db as htmlspecialchars like " or $gt;

When we go to display them we turn the & part into a specialchar again
leading to bad display.


Change-Id: Ie66dd599029f0939938f0d1d829c4156b5db6d56
Signed-off-by: Robert Lyon's avatarRobert Lyon <>
parent cae3d7a6
......@@ -1402,6 +1402,8 @@ abstract class ActivityTypePlugin extends ActivityType {
function format_notification_whitespace($message, $type=null) {
$message = preg_replace('/<br( ?\/)?>/', '', $message);
$message = preg_replace('/^(\s|&nbsp;|\xc2\xa0)*/', '', $message);
// convert any htmlspecialchars back so we don't double escape as part of format_whitespace()
$message = htmlspecialchars_decode($message);
$message = format_whitespace($message);
// @todo: Sensibly distinguish html notifications, notifications where the full text
// appears on another page and this is just an abbreviated preview, and text-only
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment