]> git.mxchange.org Git - friendica.git/blobdiff - src/App/Page.php
PL translation update THX strebski
[friendica.git] / src / App / Page.php
index 1b499f614c064b9373579b6c11399f7c3af3a968..0d7b1643635cff55cab6248a8ff96c464f245fb8 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
  *
@@ -378,10 +378,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 +426,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 +453,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 +466,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");
                        }
                }