From: Andrew Dolgov Date: Tue, 11 Sep 2012 16:16:44 +0000 (+0400) Subject: opml fixes X-Git-Tag: 1.6.0~49^2~1 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dd0a17b07a8fa30d28ccf70f225b14e6139f7336;p=tt-rss.git opml fixes --- diff --git a/classes/opml.php b/classes/opml.php index f3dbcd81..41f48df0 100644 --- a/classes/opml.php +++ b/classes/opml.php @@ -211,7 +211,7 @@ class Opml extends Handler_Protected { unset($line["owner_uid"]); $filter = json_encode($line); - $out .= "$filter"; + $out .= ""; } @@ -238,12 +238,12 @@ class Opml extends Handler_Protected { $res = $doc->saveXML(); - // saveXML uses a two-space indent. Change to tabs. +/* // saveXML uses a two-space indent. Change to tabs. $res = preg_replace_callback('/^(?: )+/mu', create_function( '$matches', 'return str_repeat("\t", intval(strlen($matches[0])/2));'), - $res); + $res); */ print $res; } @@ -269,10 +269,12 @@ class Opml extends Handler_Protected { #$this->opml_notice("[FEED] [$feed_title/$feed_url] dst_CAT=$cat_id"); $this->opml_notice(T_sprintf("Adding feed: %s", $feed_title)); + if (!$cat_id) $cat_id = 'NULL'; + $query = "INSERT INTO ttrss_feeds (title, feed_url, owner_uid, cat_id, site_url, order_id) VALUES ('$feed_title', '$feed_url', '$owner_uid', - '$cat_id', '$site_url', 0)"; + $cat_id, '$site_url', 0)"; db_query($this->link, $query); } else { @@ -291,7 +293,7 @@ class Opml extends Handler_Protected { if (!label_find_id($this->link, $label_name, $_SESSION['uid'])) { $this->opml_notice(T_sprintf("Adding label %s", htmlspecialchars($label_name))); - label_create($this->link, $label_name, $fg_color, $bg_color); + label_create($this->link, $label_name, $fg_color, $bg_color, $owner_uid); } else { $this->opml_notice(T_sprintf("Duplicate label: %s", htmlspecialchars($label_name))); }