Commit fddbef12 authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review
Browse files

Merge "Add fallback for missing rss titles (bug #897457)"

parents 97256405 aecbadde
......@@ -395,6 +395,17 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
break;
}
$description = $item->content ? $item->content : ($item->description ? $item->description : ($item->summary ? $item->summary : null));
if (!$item->title) {
if (!empty($description)) {
$item->title = substr($description, 0, 60);
}
else if ($item->link) {
$item->title = $item->link;
}
else {
$item->title = get_string('notitle', 'view');
}
}
$data->content[] = (object)array('title' => $item->title, 'link' => $item->link, 'description' => $description);
}
$cache[$source] = $data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment