joomlaworks/k2 — pull request #165 by colivier (2014-06-04 16:49:33+00:00)
Title: Problem of double encoding

The code to display the image and the link in an article in the files category_item.php, category_item_links.php et item.php uses the function K2HelperUtilities::cleanHtml with $this->item->image_caption or $this->item->title as parameters for the properties "alt" and "title"

The function K2HelperUtilities::cleanHtml uses the PHP function htmlentities.

The problem is that $this->item->image_caption and $this->item->title have already been encoded once with htmlspecialchars in the file components/com_k2/models/item.php (lignes 232 et 233) causing a double encoding.

I propose to set the "double_encode" parameter to false of the htmlentities function to prevent doubles encodings

I hope my explanations are clear

Christelle