]> git.mxchange.org Git - friendica.git/blobdiff - src/App/Page.php
Merge pull request #11515 from annando/issue-11492
[friendica.git] / src / App / Page.php
index 479abfed92dc16ccaefe1aa85ce7e4f4ddec18a1..14f0101ef07eb6f49d0207ec7620274c917a62c7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -31,7 +31,9 @@ use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
 use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
+use Friendica\Core\System;
 use Friendica\Core\Theme;
+use Friendica\Module\Response;
 use Friendica\Network\HTTPException;
 use Friendica\Util\Network;
 use Friendica\Util\Strings;
@@ -229,7 +231,7 @@ class Page implements ArrayAccess
 
                $shortcut_icon = $config->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,6 +380,12 @@ 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);
@@ -420,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();
@@ -448,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']);
                }
@@ -496,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);
                        }
                }