From eb8b5c263eb8ef9e797df8b6a30883da9f9abc6d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 17 Nov 2007 07:30:11 +0100 Subject: [PATCH] fix bug in OPML importing --- modules/opml_domdoc.php | 5 +++++ modules/opml_domxml.php | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/modules/opml_domdoc.php b/modules/opml_domdoc.php index bd10284b2..98eba69fa 100644 --- a/modules/opml_domdoc.php +++ b/modules/opml_domdoc.php @@ -63,12 +63,16 @@ if ($parent_node && $parent_node->nodeName == "outline") { $element_category = $parent_node->attributes->getNamedItem('title')->nodeValue; + if (!$element_category) $element_category = $parent_node->attributes->getNamedItem('text')->nodeValue; + } else { $element_category = ''; } if ($element_category) { + $element_category = db_escape_string($element_category); + $result = db_query($link, "SELECT id FROM ttrss_feed_categories WHERE title = '$element_category' AND owner_uid = '$owner_uid' LIMIT 1"); @@ -102,6 +106,7 @@ } + //print $add_query; db_query($link, $add_query); print "".__('Done.').""; diff --git a/modules/opml_domxml.php b/modules/opml_domxml.php index 8de842c51..54ec76b90 100644 --- a/modules/opml_domxml.php +++ b/modules/opml_domxml.php @@ -66,12 +66,16 @@ if ($parent_node && $parent_node->node_name() == "outline") { $element_category = $parent_node->get_attribute('title'); + if (!$element_category) $element_category = $parent_node->get_attribute('text'); + } else { $element_category = ''; } if ($element_category) { + $element_category = db_escape_string($element_category); + $result = db_query($link, "SELECT id FROM ttrss_feed_categories WHERE title = '$element_category' AND owner_uid = '$owner_uid' LIMIT 1");