]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix bug in OPML importing
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 17 Nov 2007 06:30:11 +0000 (07:30 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 17 Nov 2007 06:30:11 +0000 (07:30 +0100)
modules/opml_domdoc.php
modules/opml_domxml.php

index bd10284b2151465ea1b1032d85a46dd1622b4b9b..98eba69fa41f4eec6777c2351e244ce3b7115bff 100644 (file)
 
                                        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");                                                             
 
                                                }
 
+                                               //print $add_query;
                                                db_query($link, $add_query);
 
                                                print "<td><b>".__('Done.')."</b></td>";
index 8de842c51442274deae8befa58e1b79ed4e93e8e..54ec76b907681993fa2a00edd2d68f1fd9d52b47 100644 (file)
 
                                                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");