diff options
| author | 2013-09-14 18:44:41 +0200 | |
|---|---|---|
| committer | 2013-09-14 18:44:41 +0200 | |
| commit | ec448c53a39ea5ca58f16cc5aab92e1576f042d7 (patch) | |
| tree | efd2c53b97dd290682e4d16c713499a25894bb08 | |
| parent | 5072774f02a7aa8a5743d749fd8db516d6da8a79 (diff) | |
| parent | 0696890c06557770ba2ab4f101003c3e8bb95ccf (diff) | |
Merge branch 'importOpmlTitles' of https://github.com/Alkarex/FreshRSS into Alkarex-importOpmlTitles
| -rw-r--r-- | app/models/Feed.php | 2 | ||||
| -rw-r--r-- | lib/lib_rss.php | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/models/Feed.php b/app/models/Feed.php index 1b380136e..3601ed1f8 100644 --- a/app/models/Feed.php +++ b/app/models/Feed.php @@ -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 ()); diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 60e6d3358..41e95fc90 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -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; } |
