aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_acp.php
diff options
context:
space:
mode:
authoromniError <omniError@github>2014-08-09 14:40:18 -0500
committeromniError <omniError@github>2014-08-09 14:40:18 -0500
commit8989f6f8783a9d53e7b4dd33c4f64997af5824e2 (patch)
tree521eefa59aa0f1989a70af63f4d81cf5642339df /phpBB/includes/functions_acp.php
parenta7794b765cb16589155a53ebdd4cda1120c565ab (diff)
downloadforums-8989f6f8783a9d53e7b4dd33c4f64997af5824e2.tar
forums-8989f6f8783a9d53e7b4dd33c4f64997af5824e2.tar.gz
forums-8989f6f8783a9d53e7b4dd33c4f64997af5824e2.tar.bz2
forums-8989f6f8783a9d53e7b4dd33c4f64997af5824e2.tar.xz
forums-8989f6f8783a9d53e7b4dd33c4f64997af5824e2.zip
[ticket/12831] reimplemented headers as array
https://tracker.phpbb.com/browse/PHPBB3-12831 PHPBB3-12831
Diffstat (limited to 'phpBB/includes/functions_acp.php')
-rw-r--r--phpBB/includes/functions_acp.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index ce020fbdf1..8780f8e1eb 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -107,30 +107,33 @@ function adm_page_header($page_title)
'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
));
- // A listener can set this variable to `false` when it wants to prevent setting of headers
- $adm_page_header_set_headers = true;
+ // 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' => '0',
+ 'Pragma' => 'no-cache',
+ );
/**
* Execute code and/or overwrite _common_ template variables after they have been assigned.
*
* @event core.adm_page_header_after
* @var string page_title Page title
- * @var bool adm_page_header_set_headers Set to false if phpBB should not
- * set HTTP headers (useful for integrators).
+ * @var array http_headers HTTP headers that should be set by phpbb
*
* @since 3.1.0-RC3
*/
- $vars = array('page_title', 'adm_page_header_set_headers');
+ $vars = array('page_title', 'http_headers');
extract($phpbb_dispatcher->trigger_event('core.adm_page_header_after', compact($vars)));
- if ($adm_page_header_set_headers)
+ if (is_array($http_headers))
{
- // application/xhtml+xml not used because of IE
- header('Content-type: text/html; charset=UTF-8');
-
- header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: 0');
- header('Pragma: no-cache');
+ foreach ($http_headers as $hname => $hval)
+ {
+ header((string) $hname.': '.(string) $hval);
+ }
}
return;