summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-27 14:27:41 +0100
committerSimon Rettberg2023-11-27 14:27:41 +0100
commit628b3de659a1db79d15d73e88630ee1951685112 (patch)
tree54bc0076f474be1fd7fe8658041b3c17b6d1fb39
parent[inc/Render] Fix gzip compressed output (diff)
downloadbwlp-webadmin-628b3de659a1db79d15d73e88630ee1951685112.tar.gz
bwlp-webadmin-628b3de659a1db79d15d73e88630ee1951685112.tar.xz
bwlp-webadmin-628b3de659a1db79d15d73e88630ee1951685112.zip
[inc/Render] Why not go ahead and user the according output handler
-rw-r--r--inc/render.inc.php12
1 files changed, 2 insertions, 10 deletions
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
'<!DOCTYPE html>
<html lang="de">
@@ -69,13 +67,7 @@ class Render
'</body>
</html>'
;
- 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();
}
/**