1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-07 17:27:16 +02:00

[ticket/14483] Do not send headers by default on access via controller

PHPBB3-14483
This commit is contained in:
Marc Alexander
2016-03-06 18:01:31 +01:00
parent ad23b2330c
commit 62a2619300
2 changed files with 22 additions and 14 deletions

View File

@@ -4909,7 +4909,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
/**
* Generate page header
*/
function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum')
function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = true)
{
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
global $phpbb_dispatcher, $request, $phpbb_container, $phpbb_admin_path;
@@ -5249,17 +5249,22 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'SITE_LOGO_IMG' => $user->img('site_logo'),
));
// An array of http headers that phpbb will set. The following event may override these.
$http_headers = array(
// application/xhtml+xml not used because of IE
'Content-type' => 'text/html; charset=UTF-8',
'Cache-Control' => 'private, no-cache="set-cookie"',
'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',
);
if (!empty($user->data['is_bot']))
$http_headers = array();
if ($send_headers)
{
// Let reverse proxies know we detected a bot.
$http_headers['X-PHPBB-IS-BOT'] = 'yes';
// An array of http headers that phpbb will set. The following event may override these.
$http_headers += array(
// application/xhtml+xml not used because of IE
'Content-type' => 'text/html; charset=UTF-8',
'Cache-Control' => 'private, no-cache="set-cookie"',
'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',
);
if (!empty($user->data['is_bot']))
{
// Let reverse proxies know we detected a bot.
$http_headers['X-PHPBB-IS-BOT'] = 'yes';
}
}
/**