]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix remote.php CSS+JS garbish on some systems
authorArthur Schiwon <blizzz@owncloud.com>
Wed, 14 Nov 2012 11:53:36 +0000 (12:53 +0100)
committerArthur Schiwon <blizzz@owncloud.com>
Wed, 14 Nov 2012 11:53:36 +0000 (12:53 +0100)
lib/minimizer.php

index d50ab0d239727dd0bede72ce278f3b6f91c31130..79aede1704f4b11041d4f51ed8f9937431814e76 100644 (file)
@@ -33,6 +33,12 @@ abstract class OC_Minimizer {
                        $cache->set($cache_key.'.gz', $gzout);
                        OC_Response::setETagHeader($etag);
                }
+               // on some systems (e.g. SLES 11, but not Ubuntu) mod_deflate and zlib compression will compress the output twice. 
+               // This results in broken core.css and  core.js. To avoid it, we switch off zlib compression.
+               // Since mod_deflate is still active, Apache will compress what needs to be compressed, i.e. no disadvantage.
+               if(function_exists('apache_setenv') && ini_get('zlib.output_compression')) {
+                        ini_set('zlib.output_compression', 'Off');
+                }
                if ($encoding = OC_Request::acceptGZip()) {
                        header('Content-Encoding: '.$encoding);
                        $out = $gzout;