summaryrefslogtreecommitdiff
path: root/classes/opml.php
diff options
context:
space:
mode:
authorTianon Gravi <[email protected]>2017-12-29 15:26:34 -0800
committerTianon Gravi <[email protected]>2017-12-29 15:33:01 -0800
commitbbc4d4bf34a57bc288fc1761aa40f9d880b6573e (patch)
tree03cadcec08c497b4f03e8c700aaef9ebf9308d46 /classes/opml.php
parentbb0a8e323e961f44ebe52eeb002256f2f797235f (diff)
treat OPML-imported feeds without a title the same as a batch import
Diffstat (limited to 'classes/opml.php')
-rw-r--r--classes/opml.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/classes/opml.php b/classes/opml.php
index ac9e30f3d..ae995860f 100644
--- a/classes/opml.php
+++ b/classes/opml.php
@@ -289,14 +289,16 @@ class Opml extends Handler_Protected {
$site_url = mb_substr($attrs->getNamedItem('htmlUrl')->nodeValue, 0, 250);
- if ($feed_url && $feed_title) {
+ if ($feed_url) {
$sth = $this->pdo->prepare("SELECT id FROM ttrss_feeds WHERE
feed_url = ? AND owner_uid = ?");
$sth->execute([$feed_url, $owner_uid]);
+ if (!$feed_title) $feed_title = '[Unknown]';
+
if (!$sth->fetch()) {
#$this->opml_notice("[FEED] [$feed_title/$feed_url] dst_CAT=$cat_id");
- $this->opml_notice(T_sprintf("Adding feed: %s", $feed_title));
+ $this->opml_notice(T_sprintf("Adding feed: %s", $feed_title == '[Unknown]' ? $feed_url : $feed_title));
if (!$cat_id) $cat_id = null;
@@ -307,7 +309,7 @@ class Opml extends Handler_Protected {
$sth->execute([$feed_title, $feed_url, $owner_uid, $cat_id, $site_url]);
} else {
- $this->opml_notice(T_sprintf("Duplicate feed: %s", $feed_title));
+ $this->opml_notice(T_sprintf("Duplicate feed: %s", $feed_title == '[Unknown]' ? $feed_url : $feed_title));
}
}
}