]> git.wh0rd.org Git - tt-rss.git/commitdiff
only gzip xml exported data when gz functions are available
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 28 Dec 2011 07:03:24 +0000 (11:03 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 28 Dec 2011 07:03:24 +0000 (11:03 +0400)
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.";
                }