From 628b3de659a1db79d15d73e88630ee1951685112 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 27 Nov 2023 14:27:41 +0100 Subject: [inc/Render] Why not go ahead and user the according output handler --- inc/render.inc.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'inc') diff --git a/inc/render.inc.php b/inc/render.inc.php index c606fd8..6a22d3f 100644 --- a/inc/render.inc.php +++ b/inc/render.inc.php @@ -35,9 +35,7 @@ class Render public static function output(): void { Header('Content-Type: text/html; charset=utf-8'); - $zip = isset($_SERVER['HTTP_ACCEPT_ENCODING']) && (str_contains($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')); - if ($zip) - ob_start(); + ob_start('ob_gzhandler'); echo ' @@ -69,13 +67,7 @@ class Render ' ' ; - if ($zip) { - Header('Content-Encoding: gzip'); - ob_implicit_flush(false); - $gzip_contents = ob_get_contents(); - ob_end_clean(); - echo gzcompress($gzip_contents, 5, ZLIB_ENCODING_GZIP); - } + ob_end_flush(); } /** -- cgit v1.2.3-55-g7522