Skip to content

Commit

Permalink
Lower all header
Browse files Browse the repository at this point in the history
only proxy.php i evade because ther is a pr how fix this
Signed-off-by: albertlast [email protected]
  • Loading branch information
albertlast committed Feb 24, 2018
1 parent 623f23f commit d198eae
Show file tree
Hide file tree
Showing 38 changed files with 123 additions and 123 deletions.
2 changes: 1 addition & 1 deletion Packages/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
// Found it!
require(dirname(dirname(__FILE__)) . '/Settings.php');
header('Location: ' . $boardurl);
header('location: ' . $boardurl);
}
// Can't find it... just forget it.
else
Expand Down
2 changes: 1 addition & 1 deletion SSI.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@

// @todo: probably not the best place, but somewhere it should be set...
if (!headers_sent())
header('Content-Type: text/html; charset=' . (empty($modSettings['global_character_set']) ? (empty($txt['lang_character_set']) ? 'ISO-8859-1' : $txt['lang_character_set']) : $modSettings['global_character_set']));
header('content-type: text/html; charset=' . (empty($modSettings['global_character_set']) ? (empty($txt['lang_character_set']) ? 'ISO-8859-1' : $txt['lang_character_set']) : $modSettings['global_character_set']));

// Take care of any banning that needs to be done.
if (isset($_REQUEST['ssi_ban']) || (isset($ssi_ban) && $ssi_ban === true))
Expand Down
2 changes: 1 addition & 1 deletion Smileys/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
// Found it!
require(dirname(dirname(__FILE__)) . '/Settings.php');
header('Location: ' . $boardurl);
header('location: ' . $boardurl);
}
// Can't find it... just forget it.
else
Expand Down
2 changes: 1 addition & 1 deletion Sources/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ function DisplayAdminFile()
@ob_start();

// Make sure they know what type of file we are.
header('Content-Type: ' . $filetype);
header('content-type: ' . $filetype);
echo $file_data;
obExit(false);
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ protected function sendResponse()
ob_start();

// Set the header.
header('Content-Type: application/json; charset='. $context['character_set'] .'');
header('content-type: application/json; charset='. $context['character_set'] .'');

echo $smcFunc['json_encode']($this->_response ? $this->_response : array());

Expand Down
20 changes: 10 additions & 10 deletions Sources/Calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,20 +620,20 @@ function iCalDownload()
ob_start();

// Send the file headers
header('Pragma: ');
header('Cache-Control: no-cache');
header('pragma: ');
header('cache-control: no-cache');
if (!isBrowser('gecko'))
header('Content-Transfer-Encoding: binary');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . 'GMT');
header('Accept-Ranges: bytes');
header('Connection: close');
header('Content-Disposition: attachment; filename="' . $event['title'] . '.ics"');
header('content-transfer-encoding: binary');
header('expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
header('last-modified: ' . gmdate('D, d M Y H:i:s', time()) . 'GMT');
header('accept-ranges: bytes');
header('connection: close');
header('content-disposition: attachment; filename="' . $event['title'] . '.ics"');
if (empty($modSettings['enableCompressedOutput']))
header('Content-Length: ' . $smcFunc['strlen']($filecontents));
header('content-length: ' . $smcFunc['strlen']($filecontents));

// This is a calendar item!
header('Content-Type: text/calendar');
header('content-type: text/calendar');

// Chuck out the card.
echo $filecontents;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Drafts.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ function XmlDraft($id_draft)
{
global $txt, $context;

header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
header('content-type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));

echo '<?xml version="1.0" encoding="', $context['character_set'], '"?>
<drafts>
Expand Down
10 changes: 5 additions & 5 deletions Sources/Errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,14 @@ function display_loadavg_error()
function set_fatal_error_headers()
{
// Don't cache this page!
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-cache');
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-cache');

// Send the right error codes.
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600');
header('status: 503 Service Temporarily Unavailable');
header('retry-after: 3600');
}


Expand Down
8 changes: 4 additions & 4 deletions Sources/Load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3056,12 +3056,12 @@ function template_include($filename, $once = false)
ob_start();

if (isset($_GET['debug']))
header('Content-Type: application/xhtml+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
header('content-type: application/xhtml+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));

// Don't cache error pages!!
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-cache');
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-cache');

if (!isset($txt['template_parse_error']))
{
Expand Down
8 changes: 4 additions & 4 deletions Sources/News.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ function ShowXmlFeed()
ob_start();

if ($xml_format == 'smf' || isset($_REQUEST['debug']))
header('Content-Type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
header('content-type: text/xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
elseif ($xml_format == 'rss' || $xml_format == 'rss2')
header('Content-Type: application/rss+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
header('content-type: application/rss+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
elseif ($xml_format == 'atom')
header('Content-Type: application/atom+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
header('content-type: application/atom+xml; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
elseif ($xml_format == 'rdf')
header('Content-Type: ' . (isBrowser('ie') ? 'text/xml' : 'application/rdf+xml') . '; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
header('content-type: ' . (isBrowser('ie') ? 'text/xml' : 'application/rdf+xml') . '; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));

// First, output the xml header.
echo '<?xml version="1.0" encoding="', $context['character_set'], '"?' . '>';
Expand Down
2 changes: 1 addition & 1 deletion Sources/QueryString.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function cleanRequest()
// Some mail providers like to encode semicolons in activation URLs...
if (!empty($_REQUEST['action']) && substr($_SERVER['QUERY_STRING'], 0, 18) == 'action=activate%3b')
{
header('Location: ' . $scripturl . '?' . str_replace('%3b', ';', $_SERVER['QUERY_STRING']));
header('location: ' . $scripturl . '?' . str_replace('%3b', ';', $_SERVER['QUERY_STRING']));
exit;
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/ReCaptcha/RequestMethod/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function submit(RequestParameters $params)
$peer_key = version_compare(PHP_VERSION, '5.6.0', '<') ? 'CN_name' : 'peer_name';
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'header' => "content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => $params->toQueryString(),
// Force the peer to validate (not needed in 5.6.0+, but still works
Expand Down
14 changes: 7 additions & 7 deletions Sources/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -758,10 +758,10 @@ function CoppaForm()
$data = str_replace(array('{PARENT_NAME}', '{CHILD_NAME}', '{USER_NAME}', '<br>', '<br>'), array($ul, $ul, $username, $crlf, $crlf), $data);

// Send the headers.
header('Connection: close');
header('Content-Disposition: attachment; filename="approval.txt"');
header('Content-Type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream'));
header('Content-Length: ' . count($data));
header('connection: close');
header('content-disposition: attachment; filename="approval.txt"');
header('content-type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream'));
header('content-length: ' . count($data));

echo $data;
obExit(false);
Expand Down Expand Up @@ -798,7 +798,7 @@ function VerificationCode()
// Somehow no code was generated or the session was lost.
if (empty($code))
{
header('Content-Type: image/gif');
header('content-type: image/gif');
die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B");
}

Expand Down Expand Up @@ -829,14 +829,14 @@ function VerificationCode()
$_REQUEST['letter'] = (int) $_REQUEST['letter'];
if ($_REQUEST['letter'] > 0 && $_REQUEST['letter'] <= strlen($code) && !showLetterImage(strtolower($code{$_REQUEST['letter'] - 1})))
{
header('Content-Type: image/gif');
header('content-type: image/gif');
die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B");
}
}
// You must be up to no good.
else
{
header('Content-Type: image/gif');
header('content-type: image/gif');
die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B");
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/ScheduledTasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ function AutoTask()
return true;

// Finally, send some stuff...
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Type: image/gif');
header('expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('last-modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('content-type: image/gif');
die("\x47\x49\x46\x38\x39\x61\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x21\xF9\x04\x01\x00\x00\x00\x00\x2C\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3B");
}

Expand Down
8 changes: 4 additions & 4 deletions Sources/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ function secureDirectory($path, $attachments = false)
{
// Found it!
require(dirname(dirname(__FILE__)) . \'/Settings.php\');
header(\'Location: \' . $boardurl);
header(\'location: \' . $boardurl);
}
// Can\'t find it... just forget it.
else
Expand Down Expand Up @@ -1297,11 +1297,11 @@ function frameOptionsHeader($override = null)
return;

// Finally set it.
header('X-Frame-Options: ' . $option);
header('x-frame-options: ' . $option);

// And some other useful ones.
header('X-XSS-Protection: 1');
header('X-Content-Type-Options: nosniff');
header('x-xss-protection: 1');
header('x-content-type-options: nosniff');
}

?>
2 changes: 1 addition & 1 deletion Sources/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function loadSession()

// Change it so the cache settings are a little looser than default.
if (!empty($modSettings['databaseSession_loose']))
header('Cache-Control: private');
header('cache-control: private');
}

// Set the randomly generated code.
Expand Down
40 changes: 20 additions & 20 deletions Sources/ShowAttachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function showAttachment()
if (empty($modSettings['enableCompressedOutput']))
{
ob_start();
header('Content-Encoding: none');
header('content-encoding: none');
}

// Better handling.
Expand Down Expand Up @@ -193,7 +193,7 @@ function showAttachment()
if (!file_exists($file['filePath']))
{
header((preg_match('~HTTP/1\.[01]~i', $_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0') . ' 404 Not Found');
header('Content-Type: text/plain; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
header('content-type: text/plain; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));

// We need to die like this *before* we send any anti-caching headers as below.
die('File not found.');
Expand Down Expand Up @@ -248,28 +248,28 @@ function showAttachment()
);

// Send the attachment headers.
header('Pragma: ');
header('pragma: ');

if (!isBrowser('gecko'))
header('Content-Transfer-Encoding: binary');
header('content-transfer-encoding: binary');

header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($file['filePath'])) . ' GMT');
header('Accept-Ranges: bytes');
header('Connection: close');
header('ETag: ' . $eTag);
header('expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
header('last-modified: ' . gmdate('D, d M Y H:i:s', filemtime($file['filePath'])) . ' GMT');
header('accept-ranges: bytes');
header('connection: close');
header('etag: ' . $eTag);

// Make sure the mime type warrants an inline display.
if (isset($_REQUEST['image']) && !empty($file['mime_type']) && strpos($file['mime_type'], 'image/') !== 0)
unset($_REQUEST['image']);

// Does this have a mime type?
elseif (!empty($file['mime_type']) && (isset($_REQUEST['image']) || !in_array($file['fileext'], array('jpg', 'gif', 'jpeg', 'x-ms-bmp', 'png', 'psd', 'tiff', 'iff'))))
header('Content-Type: ' . strtr($file['mime_type'], array('image/bmp' => 'image/x-ms-bmp')));
header('content-type: ' . strtr($file['mime_type'], array('image/bmp' => 'image/x-ms-bmp')));

else
{
header('Content-Type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream'));
header('content-type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream'));
if (isset($_REQUEST['image']))
unset($_REQUEST['image']);
}
Expand All @@ -280,33 +280,33 @@ function showAttachment()

// Different browsers like different standards...
if (isBrowser('firefox'))
header('Content-Disposition: ' . $disposition . '; filename*=UTF-8\'\'' . rawurlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)));
header('content-disposition: ' . $disposition . '; filename*=UTF-8\'\'' . rawurlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)));

elseif (isBrowser('opera'))
header('Content-Disposition: ' . $disposition . '; filename="' . preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name) . '"');
header('content-disposition: ' . $disposition . '; filename="' . preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name) . '"');

elseif (isBrowser('ie'))
header('Content-Disposition: ' . $disposition . '; filename="' . urlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)) . '"');
header('content-disposition: ' . $disposition . '; filename="' . urlencode(preg_replace_callback('~&#(\d{3,8});~', 'fixchar__callback', $utf8name)) . '"');

else
header('Content-Disposition: ' . $disposition . '; filename="' . $utf8name . '"');
header('content-disposition: ' . $disposition . '; filename="' . $utf8name . '"');

// If this has an "image extension" - but isn't actually an image - then ensure it isn't cached cause of silly IE.
if (!isset($_REQUEST['image']) && in_array($file['fileext'], array('gif', 'jpg', 'bmp', 'png', 'jpeg', 'tiff')))
header('Cache-Control: no-cache');
header('cache-control: no-cache');

else
header('Cache-Control: max-age=' . (525600 * 60) . ', private');
header('cache-control: max-age=' . (525600 * 60) . ', private');

// Multipart and resuming support
if (isset($_SERVER['HTTP_RANGE']))
{
header("HTTP/1.1 206 Partial Content");
header("Content-Length: $new_length");
header("Content-Range: bytes $range-$range_end/$size");
header("content-length: $new_length");
header("content-range: bytes $range-$range_end/$size");
}
else
header("Content-Length: " . $size);
header("content-length: " . $size);


// Try to buy some time...
Expand Down
6 changes: 3 additions & 3 deletions Sources/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,9 @@ function SMStats()

$out = 'POST /smf/stats/collect_stats.php HTTP/1.1' . "\r\n";
$out .= 'Host: www.simplemachines.org' . "\r\n";
$out .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
$out .= 'Connection: Close' . "\r\n";
$out .= 'Content-Length: ' . $length . "\r\n\r\n";
$out .= 'content-type: application/x-www-form-urlencoded' . "\r\n";
$out .= 'connection: Close' . "\r\n";
$out .= 'content-length: ' . $length . "\r\n\r\n";
$out .= $stats_to_send . "\r\n";
fwrite($fp, $out);
fclose($fp);
Expand Down
2 changes: 1 addition & 1 deletion Sources/Subs-Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ function RequestMembers()
$_REQUEST['search'] = strtr($_REQUEST['search'], array('%' => '\%', '_' => '\_', '*' => '%', '?' => '_', '&#038;' => '&amp;'));

if (function_exists('iconv'))
header('Content-Type: text/plain; charset=UTF-8');
header('content-type: text/plain; charset=UTF-8');

$request = $smcFunc['db_query']('', '
SELECT real_name
Expand Down
2 changes: 1 addition & 1 deletion Sources/Subs-Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,7 @@ function loadLocale()
})(jQuery);';

// Make sure they know what type of file we are.
header('Content-Type: text/javascript');
header('content-type: text/javascript');
echo $file_data;
obExit(false);
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/Subs-Graphics.php
Original file line number Diff line number Diff line change
Expand Up @@ -1105,12 +1105,12 @@ function showCodeImage($code)
// Show the image.
if (function_exists('imagegif'))
{
header('Content-type: image/gif');
header('content-type: image/gif');
imagegif($code_image);
}
else
{
header('Content-type: image/png');
header('content-type: image/png');
imagepng($code_image);
}

Expand Down Expand Up @@ -1152,7 +1152,7 @@ function showLetterImage($letter)
return false;

// Include it!
header('Content-type: image/png');
header('content-type: image/png');
include($settings['default_theme_dir'] . '/fonts/' . $random_font . '/' . $letter . '.png');

// Nothing more to come.
Expand Down
Loading

0 comments on commit d198eae

Please sign in to comment.