]> git.wh0rd.org - tt-rss.git/blobdiff - classes/rpc.php
only gzip xml exported data when gz functions are available
[tt-rss.git] / classes / rpc.php
index c55d13f9a75c3e9b71ea69ae813780adbe207c7f..1da3a14ec7b277144d2c60393968841f6347e5c8 100644 (file)
@@ -20,9 +20,14 @@ class RPC extends Protected_Handler {
 
                if (file_exists($exportname)) {
                        header("Content-type: text/xml");
-                       header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml.gz");
 
-                       echo gzencode(file_get_contents($exportname));
+                       if (function_exists('gzencode')) {
+                               header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml.gz");
+                               echo gzencode(file_get_contents($exportname));
+                       } else {
+                               header("Content-Disposition: attachment; filename=TinyTinyRSS_exported.xml");
+                               echo file_get_contents($exportname);
+                       }
                } else {
                        echo "File not found.";
                }