Avoid encoding issue when printing an unhandled exception
authorAlexander Ebert <ebert@woltlab.com>
Sat, 13 May 2017 19:17:42 +0000 (21:17 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 13 May 2017 19:17:42 +0000 (21:17 +0200)
wcfsetup/install/files/lib/system/WCF.class.php

index 3a6923c555a161a8281f3ab0c1946151f46f7642..ebf3e7299c20e5a4dbdf1fb3e9a25e839a4d3fe2 100644 (file)
@@ -245,7 +245,12 @@ class WCF {
                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
-                       ob_clean();
+                       ob_end_clean();
+                       
+                       // `identity` is the default "encoding" and basically means that the client
+                       // 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');
                }
                
                // backwards compatibility