]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Merge pull request #11647 from Quix0r/fixes/type-error-exception
[friendica.git] / src / App.php
index c56222b63f5d7b52bfa9daf98b929b13842c68b7..6fa79c50144190638e8de86c1a1542dc5be8c0bb 100644 (file)
@@ -472,7 +472,7 @@ class App
                        // Allow folks to override user themes and always use their own on their own site.
                        // This works only if the user is on the same server
                        $user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]);
-                       if ($this->database->isResult($user) && !$this->pConfig->get(local_user(), 'system', 'always_my_theme')) {
+                       if ($this->database->isResult($user) && !local_user()) {
                                $page_theme = $user['theme'];
                        }
                }
@@ -504,7 +504,7 @@ class App
                if (!empty($this->profile_owner) && ($this->profile_owner != local_user())) {
                        // Allow folks to override user themes and always use their own on their own site.
                        // This works only if the user is on the same server
-                       if (!$this->pConfig->get(local_user(), 'system', 'always_my_theme')) {
+                       if (!local_user()) {
                                $page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme');
                        }
                }
@@ -576,6 +576,7 @@ class App
                $this->profiler->set(microtime(true), 'classinit');
 
                $moduleName = $this->args->getModuleName();
+               $page->setLogging($this->args->getCommand(), $this->args->getMethod());
 
                try {
                        // Missing DB connection: ERROR
@@ -710,8 +711,7 @@ class App
                        $timestamp = microtime(true);
                        $response = $module->run($input);
                        $this->profiler->set(microtime(true) - $timestamp, 'content');
-                       if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML &&
-                               $response->getStatusCode() == 200) {
+                       if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
                                $page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig);
                        } else {
                                $page->exit($response);
@@ -719,6 +719,7 @@ class App
                } catch (HTTPException $e) {
                        (new ModuleHTTPException())->rawContent($e);
                }
+               $page->logRuntime($this->config, 'runFrontend');
        }
 
        /**