Fix #2376 unnecessary header output in menu, document, layout modules

This commit is contained in:
Kijin Sung 2024-07-15 10:14:37 +09:00
parent f2bd5280c1
commit e4c3c5ac6c
3 changed files with 5 additions and 16 deletions

View file

@ -2865,15 +2865,11 @@ class DocumentController extends Document
'<?php '.
'require_once(\''.FileHandler::getRealPath('./common/autoload.php').'\'); '.
'Context::init(); '.
'Context::setCacheControl(0); '.
'header("Content-Type: text/xml; charset=UTF-8"); '.
'header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); '.
'header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); '.
'header("Cache-Control: no-store, no-cache, must-revalidate"); '.
'header("Cache-Control: post-check=0, pre-check=0", false); '.
'header("Pragma: no-cache"); '.
'%s'.
'%s '.
'$oContext->close();'.
'Context::close();'.
'?>'.
'<root>%s</root>',
$header_script,

View file

@ -618,11 +618,8 @@ class LayoutAdminController extends Layout
$stream = $tar->toTarStream();
$filename = 'faceoff_' . date('YmdHis') . '.tar';
header("Cache-Control: ");
header("Pragma: ");
Context::setCacheControl(0);
header("Content-Type: application/x-compressed");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// header("Content-Length: " .strlen($stream)); ?? why??
header('Content-Disposition: attachment; filename="'. $filename .'"');
header("Content-Transfer-Encoding: binary\n");
echo $stream;

View file

@ -1893,14 +1893,10 @@ class MenuAdminController extends Menu
'<?php ' . PHP_EOL .
'require_once('.var_export(FileHandler::getRealPath('./common/autoload.php'), true) . ');' . PHP_EOL .
'Context::init(); ' . PHP_EOL .
'Context::setCacheControl(0); ' . PHP_EOL .
'header("Content-Type: text/xml; charset=UTF-8");' . PHP_EOL .
'header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");' . PHP_EOL .
'header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");' . PHP_EOL .
'header("Cache-Control: no-store, no-cache, must-revalidate");' . PHP_EOL .
'header("Cache-Control: post-check=0, pre-check=0", false);' . PHP_EOL .
'header("Pragma: no-cache");' . PHP_EOL .
'%s' . PHP_EOL .
'$oContext->close(); ?' . '>' . PHP_EOL .
'Context::close(); ?' . '>' . PHP_EOL .
'<root>%s</root>',
$header_script,
$this->getXmlTree($tree[0], $tree, $site_srl, $domain)