using:
J!2.5.13
K2 2.6.7
If you have an item with content:
<p>ciaoàòòàòàòàààùàò</p>
<p> </p>
<p> </p>
<p>xxx</p>
and you inspect the document source in both <meta name="description"... and <meta property="og:description" you get this:
<meta property="og:description" content="ciaoàòòàòàòàààùàò � � xxx" />
<meta name="description" content="ciaoàòòàòàòàààùàò � � xxx" />
My template usese <meta charset="utf-8" /> so it's not about encoding but what happens is that the $metaDescItem variable (in com_k2/views/item/view.html.php but in other places as well) ~line:400
does:
$document->setDescription(K2_JVERSION == '15' ? $metaDescItem : html_entity_decode($metaDescItem));
and html_entity_decode causes this havoc.
Even when getting rid of the html_entity_decode in the code i still get:
<meta name="description" content="ciaoàòòàòàòàààùàò &nbsp; &nbsp; xxx" />
which would still produce rubbish in the meta description.
Adding something like:
$metaDescItem = str_replace(" ","", $metaDescItem);
just before setting the document description resolves the problem - but I do not want to do this every time I update K2, so this is really a bugfix request!
thanks
Adam