Avoid double compression with legacy exceptions
authorAlexander Ebert <ebert@woltlab.com>
Sun, 8 Apr 2018 14:00:23 +0000 (16:00 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 8 Apr 2018 14:00:23 +0000 (16:00 +0200)
wcfsetup/install/files/lib/system/WCF.class.php

index dfcc4ee1e106472a26f64f68485ee6b6987ac988..bc02426bac2962e01516b9d6e61fe9e9c5636433 100644 (file)
@@ -255,6 +255,12 @@ class WCF {
         * @param       \Exception      $e
         */
        public static final function handleException($e) {
+               // backwards compatibility
+               if ($e instanceof IPrintableException) {
+                       $e->show();
+                       exit;
+               }
+               
                if (ob_get_level()) {
                        // discard any output generated before the exception occured, prevents exception
                        // being hidden inside HTML elements and therefore not visible in browser output
@@ -291,12 +297,6 @@ class WCF {
                        }
                }
                
-               // backwards compatibility
-               if ($e instanceof IPrintableException) {
-                       $e->show();
-                       exit;
-               }
-               
                @header('HTTP/1.1 503 Service Unavailable');
                try {
                        \wcf\functions\exception\printThrowable($e);