Skip to content

Commit

Permalink
MDL-41623 rss: clean output rss content
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Sep 7, 2013
1 parent 090a5f6 commit 3a986ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions blocks/rss_client/viewfeed.php
Expand Up @@ -84,15 +84,16 @@
$feedtitle = $rss->get_title(); $feedtitle = $rss->get_title();
} }
echo '<table align="center" width="50%" cellspacing="1">'."\n"; 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) { foreach ($rss->get_items() as $item) {
echo '<tr><td valign="middle">'."\n"; 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 '</strong></a>'."\n";
echo '</td>'."\n"; echo '</td>'."\n";
echo '</tr>'."\n"; echo '</tr>'."\n";
echo '<tr><td colspan="2"><small>'; 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"; echo '</table>'."\n";


Expand Down
11 changes: 7 additions & 4 deletions blog/locallib.php
Expand Up @@ -214,11 +214,14 @@ public function print_html($return=false) {
$contentcell->text .= $template['body']; $contentcell->text .= $template['body'];
$contentcell->text .= $attachedimages; $contentcell->text .= $attachedimages;


// Uniquehash is used as a link to an external blog
if (!empty($this->uniquehash)) { if (!empty($this->uniquehash)) {
$contentcell->text .= $OUTPUT->container_start('externalblog'); // Uniquehash is used as a link to an external blog
$contentcell->text .= html_writer::link($this->uniquehash, get_string('linktooriginalentry', 'blog')); $url = clean_param($this->uniquehash, PARAM_URL);
$contentcell->text .= $OUTPUT->container_end(); if (!empty($url)) {
$contentcell->text .= $OUTPUT->container_start('externalblog');
$contentcell->text .= html_writer::link($url, get_string('linktooriginalentry', 'blog'));
$contentcell->text .= $OUTPUT->container_end();
}
} }


// Links to tags // Links to tags
Expand Down

0 comments on commit 3a986ed

Please sign in to comment.