From fd087799fd8ca7d3c858d2d0d7212811f287742d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Nov 2012 00:17:55 +0400 Subject: [PATCH] tweak opml import/export according to OPML spec --- classes/opml.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/opml.php b/classes/opml.php index 41f48df0..12beb991 100644 --- a/classes/opml.php +++ b/classes/opml.php @@ -71,7 +71,7 @@ class Opml extends Handler_Protected { $cat_title = db_fetch_result($result, 0, "title"); } - if ($cat_title) $out .= "\n"; + if ($cat_title) $out .= "\n"; $result = db_query($this->link, "SELECT id,title FROM ttrss_feed_categories WHERE @@ -129,7 +129,7 @@ class Opml extends Handler_Protected { # export tt-rss settings if ($include_settings) { - $out .= ""; + $out .= ""; $result = db_query($this->link, "SELECT pref_name, value FROM ttrss_user_prefs WHERE profile IS NULL AND owner_uid = " . $_SESSION["uid"] . " ORDER BY pref_name"); @@ -143,7 +143,7 @@ class Opml extends Handler_Protected { $out .= ""; - $out .= ""; + $out .= ""; $result = db_query($this->link, "SELECT * FROM ttrss_labels2 WHERE owner_uid = " . $_SESSION['uid']); @@ -159,7 +159,7 @@ class Opml extends Handler_Protected { $out .= ""; - $out .= ""; + $out .= ""; $result = db_query($this->link, "SELECT * FROM ttrss_filters2 WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY id"); @@ -386,7 +386,7 @@ class Opml extends Handler_Protected { $default_cat_id = (int) get_feed_category($this->link, 'Imported feeds', false); if ($root_node) { - $cat_title = db_escape_string($root_node->attributes->getNamedItem('title')->nodeValue); + $cat_title = db_escape_string($root_node->attributes->getNamedItem('text')->nodeValue); if (!in_array($cat_title, array("tt-rss-filters", "tt-rss-labels", "tt-rss-prefs"))) { $cat_id = get_feed_category($this->link, $cat_title, $parent_id); @@ -415,7 +415,7 @@ class Opml extends Handler_Protected { foreach ($outlines as $node) { if ($node->hasAttributes() && strtolower($node->tagName) == "outline") { $attrs = $node->attributes; - $node_cat_title = db_escape_string($attrs->getNamedItem('title')->nodeValue); + $node_cat_title = db_escape_string($attrs->getNamedItem('text')->nodeValue); $node_feed_url = db_escape_string($attrs->getNamedItem('xmlUrl')->nodeValue); if ($node_cat_title && !$node_feed_url) { -- 2.39.5