Merge branch 'importOpmlTitles' of https://github.com/Alkarex/FreshRSS into Alkarex-importOpmlTitles

This commit is contained in:
Marien Fressinaud
2013-09-14 18:44:41 +02:00
2 changed files with 9 additions and 1 deletions

View File

@@ -200,8 +200,10 @@ class Feed extends Model {
}
$this->_url ($subscribe_url);
}
if (empty($this->name)) { // May come from OPML
$title = $feed->get_title ();
$this->_name (!is_null ($title) ? $title : $this->url);
}
$this->_website ($feed->get_link ());
$this->_description ($feed->get_description ());

View File

@@ -133,9 +133,15 @@ function getFeedsOutline ($outline, $cat_id) {
function getFeed ($outline, $cat_id) {
$url = (string) $outline['xmlUrl'];
$title = '';
if (isset ($outline['text'])) {
$title = (string) $outline['text'];
} elseif (isset ($outline['title'])) {
$title = (string) $outline['title'];
}
$feed = new Feed ($url);
$feed->_category ($cat_id);
$feed->_name ($title);
return $feed;
}