In the AddThis class file (AddThis.php) the function private function getAttributeTitle($entity) (line 391) uses the php function htmlentities to return the text that is shared.

When using accents in text such as "cuál" this function returns "cuál" which is wrong.

Please change this to the proper php function which is htmlspecialchars and returns the text as intended.

Comments

jucedogi created an issue. See original summary.

jucedogi’s picture

Issue summary: View changes
gisle’s picture

Title: htmlentities wrong text output to share » Unicode characters in heading rendered as HTML entities
Related issues: +#1795506: Special characters rendered as html entities when shared to Twitter

This happens to me as well:

When sharing link to Nodes on Facebook via "AddThis", Unicode characters in the title (but not in the body) are shown as HTML-entities, as can be seen here: https://www.facebook.com/kjemisk/posts/940597326028362 and in the screen shot below:

Screen shot

If you add the link to your Facebook wall directly (not via "AddThis"), Unicode is displayed correctly, see https://www.facebook.com/gisle.hannemyr/posts/10153301934546227.

gisle’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Here is a patch for this problem. Please review.

gisle’s picture

Version: 7.x-4.0-alpha6 » 7.x-4.x-dev
Assigned: Unassigned » gisle
Status: Needs review » Reviewed & tested by the community

I'll review it myself.

Thanks, jucedogi - it works!

gisle’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Parent issue: » #2644044: Warning htmlspecialchars

This is actually a duplicate of #2644044: Warning htmlspecialchars - which have now been committed.