mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Merge branch 'MDL-36157-master' of https://github.com/lucaboesch/moodle
This commit is contained in:
commit
6a5d9ce4b9
@ -205,9 +205,11 @@
|
||||
}
|
||||
|
||||
if(empty($feedrecord->preferredtitle)){
|
||||
// Simplepie does escape HTML entities.
|
||||
$feedtitle = $this->format_title($simplepiefeed->get_title());
|
||||
}else{
|
||||
$feedtitle = $this->format_title($feedrecord->preferredtitle);
|
||||
// Moodle custom title does not does escape HTML entities.
|
||||
$feedtitle = $this->format_title(s($feedrecord->preferredtitle));
|
||||
}
|
||||
|
||||
if (empty($this->config->title)){
|
||||
@ -265,17 +267,19 @@
|
||||
|
||||
/**
|
||||
* Strips a large title to size and adds ... if title too long
|
||||
* This function does not escape HTML entities, so they have to be escaped
|
||||
* before being passed here.
|
||||
*
|
||||
* @param string title to shorten
|
||||
* @param int max character length of title
|
||||
* @return string title s() quoted and shortened if necessary
|
||||
* @return string title shortened if necessary
|
||||
*/
|
||||
function format_title($title,$max=64) {
|
||||
|
||||
if (core_text::strlen($title) <= $max) {
|
||||
return s($title);
|
||||
return $title;
|
||||
} else {
|
||||
return s(core_text::substr($title,0,$max-3).'...');
|
||||
return core_text::substr($title, 0, $max - 3) . '...';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ foreach($feeds as $feed) {
|
||||
if (!empty($feed->preferredtitle)) {
|
||||
$feedtitle = s($feed->preferredtitle);
|
||||
} else {
|
||||
$feedtitle = s($feed->title);
|
||||
$feedtitle = $feed->title;
|
||||
}
|
||||
|
||||
$viewlink = html_writer::link($CFG->wwwroot .'/blocks/rss_client/viewfeed.php?rssid=' . $feed->id . $extraparams, $feedtitle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user