1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-10 16:46:50 +02:00

Prevent headers in CLI mode.

This commit is contained in:
Cameron
2021-01-16 10:02:52 -08:00
parent 8f4b3429dc
commit 692b8c8538
6 changed files with 24 additions and 11 deletions

View File

@@ -2545,6 +2545,11 @@ class e_http_header
function setHeader($header, $force=false, $response_code=null)
{
if(e107::isCli())
{
return null;
}
list($key,$val) = explode(':',$header,2);
$this->headers[$key] = $val;
header($header, $force, $response_code);
@@ -2605,7 +2610,7 @@ class e_http_header
// $this->setHeader("Cache-Control: must-revalidate", true);
if($_SERVER['REQUEST_METHOD'] === 'GET' && $_SERVER['QUERY_STRING'] != 'logout' && $canCache && !deftrue('e_NOCACHE'))
if(isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'GET' && $_SERVER['QUERY_STRING'] != 'logout' && $canCache && !deftrue('e_NOCACHE'))
{
// header("Cache-Control: must-revalidate", true);
if(e107::getPref('site_page_expires')) // TODO - allow per page