summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-27 14:25:53 +0100
committerSimon Rettberg2023-11-27 14:25:53 +0100
commit517ba3a6140cc26c6e1f340a4b5c2a3cc30063f2 (patch)
treecc81ea45b01d47b80d06ce17de8a8740f28e7261 /inc
parent[agb] Add English version, link to eduGAIN CoC (diff)
downloadbwlp-webadmin-517ba3a6140cc26c6e1f340a4b5c2a3cc30063f2.tar.gz
bwlp-webadmin-517ba3a6140cc26c6e1f340a4b5c2a3cc30063f2.tar.xz
bwlp-webadmin-517ba3a6140cc26c6e1f340a4b5c2a3cc30063f2.zip
[inc/Render] Fix gzip compressed output
Diffstat (limited to 'inc')
-rw-r--r--inc/render.inc.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/inc/render.inc.php b/inc/render.inc.php
index 4318a95..c606fd8 100644
--- a/inc/render.inc.php
+++ b/inc/render.inc.php
@@ -32,10 +32,10 @@ class Render
/**
* Output the buffered, generated page
*/
- public static function output()
+ public static function output(): void
{
Header('Content-Type: text/html; charset=utf-8');
- $zip = isset($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false);
+ $zip = isset($_SERVER['HTTP_ACCEPT_ENCODING']) && (str_contains($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'));
if ($zip)
ob_start();
echo
@@ -74,8 +74,7 @@ class Render
ob_implicit_flush(false);
$gzip_contents = ob_get_contents();
ob_end_clean();
- echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
- echo substr(gzcompress($gzip_contents, 5), 0, -4);
+ echo gzcompress($gzip_contents, 5, ZLIB_ENCODING_GZIP);
}
}