diff options
Diffstat (limited to 'inc/render.inc.php')
-rw-r--r-- | inc/render.inc.php | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/inc/render.inc.php b/inc/render.inc.php index 0147709..6a22d3f 100644 --- a/inc/render.inc.php +++ b/inc/render.inc.php @@ -14,7 +14,7 @@ Render::init(); class Render { - private static $mustache = false; + private static ?Mustache_Engine $mustache = null; private static $body = ''; private static $header = ''; private static $footer = ''; @@ -24,7 +24,7 @@ class Render public static function init() { - if (self::$mustache !== false) + if (self::$mustache !== null) Util::traceError('Called Render::init() twice!'); self::$mustache = new Mustache_Engine; } @@ -32,15 +32,13 @@ 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); - if ($zip) - ob_start(); + ob_start('ob_gzhandler'); echo '<!DOCTYPE html> - <html> + <html lang="de"> <head> <title>', RENDER_DEFAULT_TITLE, self::$title, '</title> <meta charset="utf-8"> @@ -69,14 +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 "\x1f\x8b\x08\x00\x00\x00\x00\x00"; - echo substr(gzcompress($gzip_contents, 5), 0, -4); - } + ob_end_flush(); } /** |