From: Andrew Dolgov Date: Wed, 28 Dec 2011 07:03:24 +0000 (+0400) Subject: only gzip xml exported data when gz functions are available X-Git-Tag: 1.5.9~23 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=dddd80cf1bf0254c36b74531e33647e224e67993;p=tt-rss.git only gzip xml exported data when gz functions are available --- diff --git a/classes/rpc.php b/classes/rpc.php index c55d13f9..1da3a14e 100644 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -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."; }