Permalink
Browse files

MDL-41623 rss: clean output rss content

  • Loading branch information...
danpoltawski committed Sep 7, 2013
1 parent 0694d65 commit 1aecfc42b69c06c5d9f82b6641bb61c1a5cfe52b
Showing with 11 additions and 7 deletions.
  1. +4 −3 blocks/rss_client/viewfeed.php
  2. +7 −4 blog/renderer.php
@@ -84,15 +84,16 @@
$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";
View
@@ -119,11 +119,14 @@ public function render_blog_entry(blog_entry $entry) {
// 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.

0 comments on commit 1aecfc4

Please sign in to comment.