X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp.php;h=316982dd281dd08e233b9ec4a490a3f185603a1b;hb=e2f69a04b9048510849c2cb82de2359351b45cc2;hp=21675b9dc3a91b178ccafdef291b6764f39333df;hpb=edd4f06ad0084353ba81ba917464bb26e1368a34;p=friendica.git diff --git a/src/App.php b/src/App.php index 21675b9dc3..316982dd28 100644 --- a/src/App.php +++ b/src/App.php @@ -248,7 +248,6 @@ class App $this->profiler = $profiler; $this->logger = $logger; - $this->checkBackend($isBackend); $this->checkFriendicaApp(); $this->profiler->reset(); @@ -318,6 +317,8 @@ class App $this->module = 'home'; } + $this->isBackend = $isBackend || $this->checkBackend($this->module); + // Detect mobile devices $mobile_detect = new MobileDetect(); @@ -623,10 +624,10 @@ class App * This isn't a perfect solution. But we need this check very early. * So we cannot wait until the modules are loaded. * - * @param string $backend true, if the backend flag was set during App initialization - * + * @param string $module + * @return bool */ - private function checkBackend($backend) { + private function checkBackend($module) { static $backends = [ '_well_known', 'api', @@ -651,7 +652,7 @@ class App ]; // Check if current module is in backend or backend flag is set - $this->isBackend = (in_array($this->module, $backends) || $backend || $this->isBackend); + return in_array($module, $backends); } /**