Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email notifications include html entities (Trac #889) #889

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 2 comments
Closed

Email notifications include html entities (Trac #889) #889

elgg-gitbot opened this issue Feb 16, 2013 · 2 comments

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/889 on 39207089-12-31 by trac user jaakko.naakka, assigned to unknown.

Elgg version: 1.5

Notifications sent to email include html entities. For instance, a message including characters "äääöööååå" show up in email as "ää&aumlää&aumlååå". I fixed this in 1.2 modifying /engine/lib/notifications.php around line 266

$message = html_entity_decode($message, ENT_COMPAT, 'UTF-8');

The messages show up fine when reading online in Elgg, but the email version shouldn't include any html-entities. I've tried this only with the Messages plugin but I guess the same problem exists everywhere.

This issue is also present in 1.5.

@elgg-gitbot
Copy link
Author

trac user marcus wrote on 39246083-03-08

(In [svn:3180]) Closes #889: Decoding html entities from messages before stripping tags

@elgg-gitbot
Copy link
Author

trac user blahti wrote on 39615783-06-18

This is fixed in 1.6RC1. Thanks.

I was wondering if a slightly better fix would be to insert two newline characters to simulate the paragraph tags that are stripped. You end up with an email that has the appearance of paragraphs even though there is no other formatting.

    $message = preg_replace("/(\r\n|\r)/", "\n\n", $message); // Convert to unix line endings in body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant