Skip to content

Commit

Permalink
Send no-cache headers with the maintenance message.
Browse files Browse the repository at this point in the history
  • Loading branch information
reines committed Feb 10, 2011
1 parent d55266d commit f813ef5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1169,12 +1169,20 @@ function maintenance_message()
{
global $db, $pun_config, $lang_common, $pun_user;

// Send no-cache headers
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // For HTTP/1.0 compatibility

// Send the Content-type header in case the web server is setup to send something else
header('Content-type: text/html; charset=utf-8');

// Deal with newlines, tabs and multiple spaces
$pattern = array("\t", ' ', ' ');
$replace = array('    ', '  ', '  ');
$message = str_replace($pattern, $replace, $pun_config['o_maintenance_message']);


if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/maintenance.tpl'))
{
$tpl_file = PUN_ROOT.'style/'.$pun_user['style'].'/maintenance.tpl';
Expand Down

0 comments on commit f813ef5

Please sign in to comment.