Skip to content

Commit

Permalink
MDL-42711 import learnmoodle fixes: Fix the broken links in RSS feed …
Browse files Browse the repository at this point in the history
…block

If the <description> of the feed contains URLs longer than 30 characters, the
URL is split because of the break_up_long_words(). When combined with the
filter that converts URLs to links, this produces broken links.

The proper solution would be to improve break_up_long_words() so that it does
not modifies URLs at all. As a temporary solution for our purpose now is to
call format_text() prior to break_up_long_words() as it will not modify the
inner content of the <a> tag.

This should be fixed upstream. See also discussion at
https://moodle.org/mod/forum/discuss.php?d=34947
  • Loading branch information
mudrd8mz authored and Aparup Banerjee committed Nov 8, 2013
1 parent b661e76 commit 1d93c9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blocks/rss_client/block_rss_client.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,13 @@ function get_item_html($item){

if($this->config->display_description && !empty($description)){

$description = break_up_long_words($description, 30);

$formatoptions = new stdClass();
$formatoptions->para = false;

$r.= html_writer::start_tag('div',array('class'=>'description'));
$r.= format_text($description, FORMAT_HTML, $formatoptions, $this->page->course->id);
$description = format_text($description, FORMAT_HTML, $formatoptions, $this->page->course->id);
$description = break_up_long_words($description, 30);
$r.= $description;
$r.= html_writer::end_tag('div');
}
$r.= html_writer::end_tag('li');
Expand Down

0 comments on commit 1d93c9a

Please sign in to comment.