Merge branch 'master' into next
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / lib / system / WCF.class.php
index 06aad8f1beecc191d105e76d2c25ac10ba9c5375..3ab7dc1ac55791383949331b1eece7c1f01bcd72 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 namespace wcf\system;
 use wcf\data\application\Application;
 use wcf\data\option\OptionEditor;
@@ -284,9 +285,9 @@ class WCF {
                        // Especially the `identity` value appears to be unrecognized by some of them, hence
                        // we'll just gzip the output of the exception to prevent them from tampering.
                        // This part is copied from `HeaderUtil` in order to isolate the exception handler!
-                       if (HTTP_ENABLE_GZIP && !defined('HTTP_DISABLE_GZIP')) {
-                               if (function_exists('gzcompress') && !@ini_get('zlib.output_compression') && !@ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
-                                       if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip')) {
+                       if (defined('HTTP_ENABLE_GZIP') && HTTP_ENABLE_GZIP && !defined('HTTP_DISABLE_GZIP')) {
+                               if (function_exists('gzcompress') && !@ini_get('zlib.output_compression') && !@ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
+                                       if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false) {
                                                @header('Content-Encoding: x-gzip');
                                        }
                                        else {
@@ -320,14 +321,6 @@ class WCF {
                        echo "\n\nwas handled.</pre>";
                        exit;
                }
-               catch (\Exception $e2) {
-                       echo "<pre>An Exception was thrown while handling an Exception:\n\n";
-                       echo preg_replace('/Database->__construct\(.*\)/', 'Database->__construct(...)', $e2);
-                       echo "\n\nwas thrown while:\n\n";
-                       echo preg_replace('/Database->__construct\(.*\)/', 'Database->__construct(...)', $e);
-                       echo "\n\nwas handled.</pre>";
-                       exit;
-               }
        }
        
        /**
@@ -671,6 +664,7 @@ class WCF {
         * Returns the invoked application.
         * 
         * @return      Application
+        * @since       3.1
         */
        public static function getActiveApplication() {
                return ApplicationHandler::getInstance()->getActiveApplication();