Improved exception handling w/ enabled gzip
authorAlexander Ebert <ebert@woltlab.com>
Sat, 13 May 2017 22:14:37 +0000 (00:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 13 May 2017 22:14:37 +0000 (00:14 +0200)
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/util/HeaderUtil.class.php

index ebf3e7299c20e5a4dbdf1fb3e9a25e839a4d3fe2..2b26bf95f0ff4cd0f34d3090dfb106197c86a58c 100644 (file)
@@ -34,6 +34,7 @@ use wcf\system\template\EmailTemplateEngine;
 use wcf\system\template\TemplateEngine;
 use wcf\system\user\storage\UserStorageHandler;
 use wcf\util\FileUtil;
+use wcf\util\HeaderUtil;
 use wcf\util\StringUtil;
 use wcf\util\UserUtil;
 
@@ -251,6 +252,7 @@ class WCF {
                        // must treat the content as if the header did not appear in first place, this
                        // also overrules the gzip header if present
                        @header('Content-Encoding: identity');
+                       HeaderUtil::exceptionDisableGzip();
                }
                
                // backwards compatibility
index 1db10abb77f0e1c1eeafddf82df4537ebfdc6150..955450cf8d2ff6e2e785e3f13b48e771e6756ad7 100644 (file)
@@ -93,6 +93,14 @@ final class HeaderUtil {
                @header('Pragma: no-cache');
        }
        
+       /**
+        * Disables gzip compression on runtime in case of an exception. You should not call
+        * this method at all, it exists for exception handling only.
+        */
+       public static function exceptionDisableGzip() {
+               self::$enableGzipCompression = false;
+       }
+       
        /**
         * Parses the rendered output.
         *