mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-23 07:15:50 -04:00
Don't send back the gzipped version if we're using
zlib.output_compression in PHP, since that means that the stream is already compressed. Fixes ticket 555.
This commit is contained in:
@@ -60,14 +60,15 @@ class Combined_Controller extends Controller {
|
||||
|
||||
$cache = Cache::instance();
|
||||
$use_gzip = function_exists("gzencode") &&
|
||||
(strpos($input->server("HTTP_ACCEPT_ENCODING"), "gzip") !== false);
|
||||
stripos($input->server("HTTP_ACCEPT_ENCODING"), "gzip") !== false &&
|
||||
(int) ini_get("zlib.output_compression") === 0;
|
||||
|
||||
if ($use_gzip && $content = $cache->get("{$key}_gz")) {
|
||||
header("Content-Encoding: gzip");
|
||||
} else {
|
||||
// Fall back to non-gzipped if we have to
|
||||
$content = $cache->get($key);
|
||||
}
|
||||
|
||||
if (empty($content)) {
|
||||
Kohana::show_404();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user