MDL-41623 rss: clean output rss content

This commit is contained in:
Dan Poltawski
2013-09-07 10:42:02 +08:00
parent 178af4770e
commit 39616d39c4
2 changed files with 11 additions and 7 deletions
+4 -3
View File
@@ -84,15 +84,16 @@ if (!empty($rssrecord->preferredtitle)) {
$feedtitle = $rss->get_title();
}
echo '<table align="center" width="50%" cellspacing="1">'."\n";
echo '<tr><td colspan="2"><strong>'. $feedtitle .'</strong></td></tr>'."\n";
echo '<tr><td colspan="2"><strong>'. s($feedtitle) .'</strong></td></tr>'."\n";
foreach ($rss->get_items() as $item) {
echo '<tr><td valign="middle">'."\n";
echo '<a href="'. $item->get_link() .'" target="_blank"><strong>'. $item->get_title();
echo '<a href="'.$item->get_link().'" target="_blank"><strong>';
echo s($item->get_title());
echo '</strong></a>'."\n";
echo '</td>'."\n";
echo '</tr>'."\n";
echo '<tr><td colspan="2"><small>';
echo $item->get_description() .'</small></td></tr>'."\n";
echo format_text($item->get_description(), FORMAT_HTML) .'</small></td></tr>'."\n";
}
echo '</table>'."\n";
+7 -4
View File
@@ -119,11 +119,14 @@ class core_blog_renderer extends plugin_renderer_base {
// Body.
$o .= format_text($entry->summary, $entry->summaryformat, array('overflowdiv' => true));
// Uniquehash is used as a link to an external blog.
if (!empty($entry->uniquehash)) {
$o .= $this->output->container_start('externalblog');
$o .= html_writer::link($entry->uniquehash, get_string('linktooriginalentry', 'blog'));
$o .= $this->output->container_end();
// Uniquehash is used as a link to an external blog.
$url = clean_param($entry->uniquehash, PARAM_URL);
if (!empty($url)) {
$o .= $this->output->container_start('externalblog');
$o .= html_writer::link($url, get_string('linktooriginalentry', 'blog'));
$o .= $this->output->container_end();
}
}
// Links to tags.