Skip to content

Commit

Permalink
Only gzip encode if configured to do so
Browse files Browse the repository at this point in the history
As its likely the web server will do this for us already
  • Loading branch information
jrgp committed Jun 16, 2018
1 parent dfe15d6 commit a2c8662
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions sample.config.inc.php
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion src/Linfo/Output/Html.php
Expand Up @@ -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
Expand Down

0 comments on commit a2c8662

Please sign in to comment.