From a2c8662805333c4921b9b40d4d6c333b0a63fbea Mon Sep 17 00:00:00 2001 From: Joe Gillotti Date: Sat, 16 Jun 2018 15:13:56 -0700 Subject: [PATCH] Only gzip encode if configured to do so As its likely the web server will do this for us already --- sample.config.inc.php | 1 + src/Linfo/Output/Html.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sample.config.inc.php b/sample.config.inc.php index 3d2a2587..7ba3f29f 100644 --- a/sample.config.inc.php +++ b/sample.config.inc.php @@ -11,6 +11,7 @@ $settings['language'] = 'en'; // Refer to the lang/ folder for supported languages $settings['icons'] = true; // simple icons $settings['theme'] = 'default'; // Theme file (layout/theme_$n.css). Look at the contents of the layout/ folder for other themes. +$settings['gzip'] = false; // Manually gzip output. Unneeded if your web server already does it. $settings['allow_changing_themes'] = false; // Allow changing the theme per user in the UI? diff --git a/src/Linfo/Output/Html.php b/src/Linfo/Output/Html.php index c2a45329..fbf72663 100644 --- a/src/Linfo/Output/Html.php +++ b/src/Linfo/Output/Html.php @@ -148,7 +148,7 @@ public function output() // Start compressed output buffering. Try to not do this if we've had errors or otherwise already outputted stuff if ((!function_exists('error_get_last') || !error_get_last()) && (!isset($settings['compress_content']) || $settings['compress_content'])) { ob_end_clean(); - ob_start(function_exists('ob_gzhandler') ? 'ob_gzhandler' : null); + ob_start(isset($settings['gzip']) && $settings['gzip'] && function_exists('ob_gzhandler') ? 'ob_gzhandler' : null); } // If we're allowed to change themes client-side, generate a list of custom ones to use as a white list