Skip to content

Commit

Permalink
FS#2738, fix double encoding of html entities in RSS feeds (updates f…
Browse files Browse the repository at this point in the history
…eed.php for changes to Diff class introduced in PR#179)
  • Loading branch information
Chris--S committed Apr 10, 2013
1 parent df9752e commit a494ed3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions feed.php
Expand Up @@ -322,23 +322,25 @@ function rss_buildItems(&$rss, &$data, $opt) {
$rev = $revs[0];

if($rev) {
$df = new Diff(explode("\n", htmlspecialchars(rawWiki($id, $rev))),
explode("\n", htmlspecialchars(rawWiki($id, ''))));
$df = new Diff(explode("\n", rawWiki($id, $rev)),
explode("\n", rawWiki($id, '')));
} else {
$df = new Diff(array(''),
explode("\n", htmlspecialchars(rawWiki($id, ''))));
explode("\n", rawWiki($id, '')));
}

if($opt['item_content'] == 'htmldiff') {
// note: no need to escape diff output, TableDiffFormatter provides 'safe' html
$tdf = new TableDiffFormatter();
$content = '<table>';
$content .= '<tr><th colspan="2" width="50%">'.$rev.'</th>';
$content .= '<th colspan="2" width="50%">'.$lang['current'].'</th></tr>';
$content .= $tdf->format($df);
$content .= '</table>';
} else {
// note: diff output must be escaped, UnifiedDiffFormatter provides plain text
$udf = new UnifiedDiffFormatter();
$content = "<pre>\n".$udf->format($df)."\n</pre>";
$content = "<pre>\n".hsc($udf->format($df))."\n</pre>";
}
}
break;
Expand Down

0 comments on commit a494ed3

Please sign in to comment.