Follow-on patch for http://bugs.cacert.org/view.php?id=1190
"News does not display teaser".
This commit is contained in:
parent
3dfac78f84
commit
a32e012dc8
1 changed files with 9 additions and 4 deletions
|
@ -53,11 +53,16 @@
|
||||||
|
|
||||||
$query = "./description";
|
$query = "./description";
|
||||||
$nodeList = $xpath->query($query, $item);
|
$nodeList = $xpath->query($query, $item);
|
||||||
$description = recode_string("UTF8..html" , $nodeList->item(0)->nodeValue);
|
$description = $nodeList->item(0)->nodeValue;
|
||||||
|
// The description may contain HTML entities => convert them
|
||||||
|
$description = html_entity_decode($description, ENT_COMPAT | ENT_HTML401, 'UTF-8');
|
||||||
|
// Description may contain HTML markup and unicode characters => encode them
|
||||||
|
// If we didn't decode and then encode again, (i.e. take the content
|
||||||
|
// as it is in the RSS feed) we might inject harmful markup
|
||||||
|
$description = recode_string("UTF8..html", $description);
|
||||||
|
|
||||||
printf("<h3> %s </h3>\n", $title);
|
printf("<h3><a href=\"%s\">%s</a></h3>\n", $link, $title);
|
||||||
printf("<p> %s </p>\n", $description);
|
printf("<p>%s</p>\n", nl2br($description));
|
||||||
printf("<p>[<a href=\"%s\"> %s </a> ] </p>\n\n", $link,_("Full Story"));
|
|
||||||
|
|
||||||
$title = '';
|
$title = '';
|
||||||
$description = '';
|
$description = '';
|
||||||
|
|
Loading…
Reference in a new issue