]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Fix notices because of unknown Hubzilla activity type
[friendica.git] / src / App.php
index 4a9552aafb2b2e5b7ea326fed2d788eb7a9247ff..5c74b1b539388750f7b2c8300351ac34a07795dd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -24,6 +24,8 @@ namespace Friendica;
 use Exception;
 use Friendica\App\Arguments;
 use Friendica\App\BaseURL;
+use Friendica\App\Module;
+use Friendica\Module\Maintenance;
 use Friendica\Security\Authentication;
 use Friendica\Core\Config\Cache;
 use Friendica\Core\Config\IConfig;
@@ -32,6 +34,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Database\Database;
+use Friendica\Model\Contact;
 use Friendica\Model\Profile;
 use Friendica\Module\Special\HTTPException as ModuleHTTPException;
 use Friendica\Network\HTTPException;
@@ -462,6 +465,11 @@ class App
                                                if (Core\Session::get('visitor_home') != $_GET["zrl"]) {
                                                        Core\Session::set('my_url', $_GET['zrl']);
                                                        Core\Session::set('authenticated', 0);
+
+                                                       $remote_contact = Contact::getByURL($_GET['zrl'], false, ['subscribe']);
+                                                       if (!empty($remote_contact['subscribe'])) {
+                                                               $_SESSION['remote_comment'] = $remote_contact['subscribe'];
+                                                       }
                                                }
 
                                                Model\Profile::zrlInit($this);
@@ -499,8 +507,6 @@ class App
                        // but we need "view" module for stylesheet
                        if ($this->mode->isInstall() && $moduleName !== 'install') {
                                $this->baseURL->redirect('install');
-                       } elseif (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED) && $moduleName !== 'maintenance') {
-                               $this->baseURL->redirect('maintenance');
                        } else {
                                $this->checkURL();
                                Core\Update::check($this->getBasePath(), false, $this->mode);
@@ -544,9 +550,13 @@ class App
                        // Initialize module that can set the current theme in the init() method, either directly or via App->profile_uid
                        $page['page_title'] = $moduleName;
 
-                       // determine the module class and save it to the module instance
-                       // @todo there's an implicit dependency due SESSION::start(), so it has to be called here (yet)
-                       $module = $module->determineClass($this->args, $router, $this->config);
+                       if (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED)) {
+                               $module = new Module('maintenance', Maintenance::class);
+                       } else {
+                               // determine the module class and save it to the module instance
+                               // @todo there's an implicit dependency due SESSION::start(), so it has to be called here (yet)
+                               $module = $module->determineClass($this->args, $router, $this->config);
+                       }
 
                        // Let the module run it's internal process (init, get, post, ...)
                        $module->run($this->l10n, $this->baseURL, $this->logger, $this->profiler, $_SERVER, $_POST);