diff options
author | Heiko Adams <[email protected]> | 2015-11-30 10:29:44 +0100 |
---|---|---|
committer | Heiko Adams <[email protected]> | 2015-11-30 10:29:44 +0100 |
commit | 05761788b7b5a8a7e6c14333669acd0793886223 (patch) | |
tree | 464ccc3d98900e5dcf1a437662056161fa1280a4 /plugins/import_export/init.php | |
parent | 635ecdb9fa039adb8a0e8ead045bfda023e72bc4 (diff) | |
parent | 6f5d9c6889b6376527d7598857ac8816cf7980ab (diff) |
Merge remote-tracking branch 'origin/master' into german-translation
Diffstat (limited to 'plugins/import_export/init.php')
-rw-r--r-- | plugins/import_export/init.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php index e61b62b67..7c628909f 100644 --- a/plugins/import_export/init.php +++ b/plugins/import_export/init.php @@ -106,11 +106,13 @@ class Import_Export extends Plugin implements IHandler { if (file_exists($exportname)) { header("Content-type: text/xml"); + $timestamp_suffix = date("Y-m-d", filemtime($exportname)); + if (function_exists('gzencode')) { - header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml.gz"); + header("Content-Disposition: attachment; filename=TinyTinyRSS_exported_${timestamp_suffix}.xml.gz"); echo gzencode(file_get_contents($exportname)); } else { - header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml"); + header("Content-Disposition: attachment; filename=TinyTinyRSS_exported_${timestamp_suffix}.xml"); echo file_get_contents($exportname); } } else { @@ -239,10 +241,13 @@ class Import_Export extends Plugin implements IHandler { $article = array(); foreach ($article_node->childNodes as $child) { - if ($child->nodeName != 'label_cache') - $article[$child->nodeName] = db_escape_string($child->nodeValue); - else + if ($child->nodeName == 'content') { + $article[$child->nodeName] = db_escape_string($child->nodeValue, false); + } else if ($child->nodeName == 'label_cache') { $article[$child->nodeName] = $child->nodeValue; + } else { + $article[$child->nodeName] = db_escape_string($child->nodeValue); + } } //print_r($article); @@ -348,7 +353,6 @@ class Import_Export extends Plugin implements IHandler { $score = (int) $article['score']; $tag_cache = $article['tag_cache']; - $label_cache = db_escape_string($article['label_cache']); $note = $article['note']; //print "Importing " . $article['title'] . "<br/>"; @@ -361,9 +365,9 @@ class Import_Export extends Plugin implements IHandler { published, score, tag_cache, label_cache, uuid, note) VALUES ($ref_id, $owner_uid, $feed, false, NULL, $marked, $published, $score, '$tag_cache', - '$label_cache', '', '$note')"); + '', '', '$note')"); - $label_cache = json_decode($label_cache, true); + $label_cache = json_decode($article['label_cache'], true); if (is_array($label_cache) && $label_cache["no-labels"] != 1) { foreach ($label_cache as $label) { |