svrjs-mods-directory/includes/moderation_final.php

26 lines
774 B
PHP
Raw Normal View History

2024-12-27 15:05:54 +01:00
<?php
if (!defined('SVRJS_MOD_DIRECTORY')) die;
if (!defined('SVRJS_MOD_DIRECTORY_MODERATION')) die;
if (session_id()) session_write_close();
if (ob_get_status()) {
$content = ob_get_clean();
if ($content && COMPRESSION_ENABLED && isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
$acceptEncoding = array_map(function ($encoding) {
return trim($encoding);
}, explode(',', $_SERVER['HTTP_ACCEPT_ENCODING']));
if (in_array('gzip', $acceptEncoding)) {
$content = gzencode($content, 9);
header('Content-Encoding: gzip');
} elseif (in_array('deflate', $acceptEncoding)) {
$content = gzdeflate($content, 9);
header('Content-Encoding: deflate');
}
}
echo $content;
}