diff --git a/banner.php b/banner.php index 3e36577e2..a32c71607 100644 --- a/banner.php +++ b/banner.php @@ -12,5 +12,3 @@ require_once("class2.php"); require_once(e_PLUGIN."banner/banner.php"); -exit(); -?> \ No newline at end of file diff --git a/class2.php b/class2.php index fe6ba6633..ee82f962b 100755 --- a/class2.php +++ b/class2.php @@ -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 diff --git a/e107_core/templates/footer_default.php b/e107_core/templates/footer_default.php index e8b05895c..a02f2387c 100644 --- a/e107_core/templates/footer_default.php +++ b/e107_core/templates/footer_default.php @@ -441,9 +441,11 @@ unset($In_e107_Footer); // Clean session shutdown -e107::getSession()->shutdown(); // moved from the top of footer_default.php to fix https://github.com/e107inc/e107/issues/1446 (session closing before page was complete) -// Shutdown -$e107->destruct(); -$e107_Clean_Exit=true; // For registered shutdown function -- let it know all is well! - +if(!e107::isCli()) +{ + e107::getSession()->shutdown(); // moved from the top of footer_default.php to fix https://github.com/e107inc/e107/issues/1446 (session closing before page was complete) + // Shutdown + $e107->destruct(); + $e107_Clean_Exit=true; // For registered shutdown function -- let it know all is well! +} diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index ac5c77654..9b030dc45 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -89,8 +89,10 @@ $js_body_onload = array(); // Legacy array of code to load with page. //if (stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml")) // header("Content-type: application/xhtml+xml; charset=utf-8", TRUE); //else - header("Content-type: text/html; charset=utf-8", TRUE); - +if(!e107::isCli()) +{ + header("Content-type: text/html; charset=utf-8", true); +} // NEW - HTML5 default // TODO - more precise controlo over page header depending on the HTML5 mode if(!defined("XHTML4")) diff --git a/e107_handlers/traffic_class.php b/e107_handlers/traffic_class.php index 2cc0f71e4..1fd720550 100644 --- a/e107_handlers/traffic_class.php +++ b/e107_handlers/traffic_class.php @@ -53,6 +53,12 @@ class e107_traffic { $tFrom = explode(' ', $tStart); $tTo = explode(' ', $tFinish); + + if(!isset($tFrom[1])) + { + $tFrom[1] = 0; + } + $tTot = ((float) $tTo[0] + (float) $tTo[1]) - ((float) $tFrom[0] + (float) $tFrom[1]); return $tTot; } diff --git a/e107_plugins/banner/banner.php b/e107_plugins/banner/banner.php index a2ae3d932..51e1ae5c4 100644 --- a/e107_plugins/banner/banner.php +++ b/e107_plugins/banner/banner.php @@ -137,7 +137,7 @@ if (isset($_POST['clientsubmit'])) } $scArray = array(); -$scArray['BANNER_LOGIN_TABLE_LOGIN'] = $frm->text("clientlogin", $id); +$scArray['BANNER_LOGIN_TABLE_LOGIN'] = $frm->text("clientlogin"); $scArray['BANNER_LOGIN_TABLE_PASSW'] = $frm->password("clientpassword", ''); $scArray['BANNER_LOGIN_TABLE_SUBMIT'] = $frm->button("clientsubmit", LAN_CONTINUE, "submit");