summaryrefslogtreecommitdiff
path: root/plugins/import_export/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/import_export/init.php')
-rw-r--r--plugins/import_export/init.php20
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) {