X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp%2FPage.php;h=14f0101ef07eb6f49d0207ec7620274c917a62c7;hb=204e52ea307b182175ae0c64d6eb69c71a104658;hp=1b499f614c064b9373579b6c11399f7c3af3a968;hpb=7cd85873ee321263ff9b4e77fc121dca1c9dae6f;p=friendica.git diff --git a/src/App/Page.php b/src/App/Page.php index 1b499f614c..14f0101ef0 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -1,6 +1,6 @@ get('system', 'shortcut_icon'); if ($shortcut_icon == '') { - $shortcut_icon = 'images/friendica-32.png'; + $shortcut_icon = 'images/friendica.svg'; } $touch_icon = $config->get('system', 'touch_icon'); @@ -378,10 +380,19 @@ class Page implements ArrayAccess */ public function exit(ResponseInterface $response) { + header(sprintf("HTTP/%s %s %s", + $response->getProtocolVersion(), + $response->getStatusCode(), + $response->getReasonPhrase()) + ); + foreach ($response->getHeaders() as $key => $header) { if (is_array($header)) { $header_str = implode(',', $header); + } else { + $header_str = $header; } + if (empty($key)) { header($header_str); } else { @@ -417,7 +428,6 @@ class Page implements ArrayAccess */ $timestamp = microtime(true); $this->initContent($response, $mode); - $profiler->set(microtime(true) - $timestamp, 'content'); // Load current theme info after module has been initialized as theme could have been set in module $currentTheme = $app->getCurrentTheme(); @@ -445,6 +455,8 @@ class Page implements ArrayAccess */ $this->initFooter($app, $mode, $l10n); + $profiler->set(microtime(true) - $timestamp, 'aftermath'); + if (!$mode->isAjax()) { Hook::callAll('page_end', $this->page['content']); } @@ -456,10 +468,16 @@ class Page implements ArrayAccess } foreach ($response->getHeaders() as $key => $header) { + if (is_array($header)) { + $header_str = implode(',', $header); + } else { + $header_str = $header; + } + if (empty($key)) { - header($header); + header($header_str); } else { - header("$key: $header"); + header("$key: $header_str"); } } @@ -487,11 +505,7 @@ class Page implements ArrayAccess } if ($_GET["mode"] == "raw") { - header("Content-type: text/html; charset=utf-8"); - - echo substr($target->saveHTML(), 6, -8); - - exit(); + System::httpExit(substr($target->saveHTML(), 6, -8), Response::TYPE_HTML); } }