// Import
- private function opml_import_feed($doc, $node, $cat_id, $owner_uid) {
+ private function opml_import_feed($node, $cat_id, $owner_uid) {
$attrs = $node->attributes;
$feed_title = $this->dbh->escape_string(mb_substr($attrs->getNamedItem('text')->nodeValue, 0, 250));
}
}
- private function opml_import_label($doc, $node, $owner_uid) {
+ private function opml_import_label($node, $owner_uid) {
$attrs = $node->attributes;
$label_name = $this->dbh->escape_string($attrs->getNamedItem('label-name')->nodeValue);
}
}
- private function opml_import_preference($doc, $node, $owner_uid) {
+ private function opml_import_preference($node) {
$attrs = $node->attributes;
$pref_name = $this->dbh->escape_string($attrs->getNamedItem('pref-name')->nodeValue);
}
}
- private function opml_import_filter($doc, $node, $owner_uid) {
+ private function opml_import_filter($node) {
$attrs = $node->attributes;
$filter_type = $this->dbh->escape_string($attrs->getNamedItem('filter-type')->nodeValue);
}
private function opml_import_category($doc, $root_node, $owner_uid, $parent_id) {
- $body = $doc->getElementsByTagName('body');
-
$default_cat_id = (int) get_feed_category('Imported feeds', false);
if ($root_node) {
switch ($cat_title) {
case "tt-rss-prefs":
- $this->opml_import_preference($doc, $node, $owner_uid);
+ $this->opml_import_preference($node);
break;
case "tt-rss-labels":
- $this->opml_import_label($doc, $node, $owner_uid);
+ $this->opml_import_label($node, $owner_uid);
break;
case "tt-rss-filters":
- $this->opml_import_filter($doc, $node, $owner_uid);
+ $this->opml_import_filter($node);
break;
default:
- $this->opml_import_feed($doc, $node, $dst_cat_id, $owner_uid);
+ $this->opml_import_feed($node, $dst_cat_id, $owner_uid);
}
}
}
function opml_import($owner_uid) {
if (!$owner_uid) return;
- $debug = isset($_REQUEST["debug"]);
$doc = false;
-# if ($debug) $doc = DOMDocument::load("/tmp/test.opml");
-
if ($_FILES['opml_file']['error'] != 0) {
print_error(T_sprintf("Upload failed with error code %d",
$_FILES['opml_file']['error']));
return;
}
- $tmp_file = false;
-
if (is_uploaded_file($_FILES['opml_file']['tmp_name'])) {
$tmp_file = tempnam(CACHE_DIR . '/upload', 'opml');