From: Andrew Dolgov Date: Sat, 17 Nov 2007 06:30:11 +0000 (+0100) Subject: fix bug in OPML importing X-Git-Tag: 1.2.17~27 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=eb8b5c263eb8ef9e797df8b6a30883da9f9abc6d;p=tt-rss.git fix bug in OPML importing --- diff --git a/modules/opml_domdoc.php b/modules/opml_domdoc.php index bd10284b..98eba69f 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 8de842c5..54ec76b9 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");