aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/Feed.php2
-rw-r--r--lib/lib_rss.php8
2 files changed, 9 insertions, 1 deletions
diff --git a/app/models/Feed.php b/app/models/Feed.php
index 678809af6..f714994e9 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 a7a5244f8..0711f9d8a 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;
}