]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Merge pull request #7090 from nupplaphil/task/mod_like
[friendica.git] / src / App.php
index adcb5d7d5469ce4815eb383976c4d3c31429e71d..017661c4ca666081ad997b5e5d97ad7ce3ed4d08 100644 (file)
@@ -87,11 +87,6 @@ class App
         */
        private $baseURL;
 
-       /**
-        * @var bool true, if the call is from the Friendica APP, otherwise false
-        */
-       private $isFriendicaApp;
-
        /**
         * @var bool true, if the call is from an backend node (f.e. worker)
         */
@@ -257,8 +252,6 @@ class App
                $this->profiler = $profiler;
                $this->logger   = $logger;
 
-               $this->checkFriendicaApp();
-
                $this->profiler->reset();
 
                $this->reload();
@@ -405,8 +398,6 @@ class App
         * @param bool $ssl Whether to append http or https under BaseURL::SSL_POLICY_SELFSIGN
         *
         * @return string Friendica server base URL
-        *
-        * @deprecated 2019.06 - use BaseURL->get($ssl) instead
         */
        public function getBaseURL($ssl = false)
        {
@@ -508,7 +499,6 @@ class App
                 * being first
                 */
                $this->page['htmlhead'] = Core\Renderer::replaceMacros($tpl, [
-                       '$baseurl'         => $this->getBaseURL(),
                        '$local_user'      => local_user(),
                        '$generator'       => 'Friendica' . ' ' . FRIENDICA_VERSION,
                        '$delitem'         => Core\L10n::t('Delete this item?'),
@@ -561,7 +551,6 @@ class App
 
                $tpl = Core\Renderer::getMarkupTemplate('footer.tpl');
                $this->page['footer'] = Core\Renderer::replaceMacros($tpl, [
-                       '$baseurl' => $this->getBaseURL(),
                        '$footerScripts' => $this->footerScripts,
                ]) . $this->page['footer'];
        }
@@ -605,28 +594,6 @@ class App
                        $this->getBaseURL();
        }
 
-       /**
-        * Checks, if the call is from the Friendica App
-        *
-        * Reason:
-        * The friendica client has problems with the GUID in the notify. this is some workaround
-        */
-       private function checkFriendicaApp()
-       {
-               // Friendica-Client
-               $this->isFriendicaApp = isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] == 'Apache-HttpClient/UNAVAILABLE (java 1.4)';
-       }
-
-       /**
-        *      Is the call via the Friendica app? (not a "normale" call)
-        *
-        * @return bool true if it's from the Friendica app
-        */
-       public function isFriendicaApp()
-       {
-               return $this->isFriendicaApp;
-       }
-
        /**
         * @brief Checks if the site is called via a backend process
         *
@@ -1010,10 +977,9 @@ class App
        {
                // Missing DB connection: ERROR
                if ($this->getMode()->has(App\Mode::LOCALCONFIGPRESENT) && !$this->getMode()->has(App\Mode::DBAVAILABLE)) {
-                       echo Module\Special\HTTPException::rawContent(
+                       Module\Special\HTTPException::rawContent(
                                new HTTPException\InternalServerErrorException('Apologies but the website is unavailable at the moment.')
                        );
-                       exit;
                }
 
                // Max Load Average reached: ERROR
@@ -1021,17 +987,15 @@ class App
                        header('Retry-After: 120');
                        header('Refresh: 120; url=' . $this->getBaseURL() . "/" . $this->query_string);
 
-                       echo Module\Special\HTTPException::rawContent(
+                       Module\Special\HTTPException::rawContent(
                                new HTTPException\ServiceUnavaiableException('The node is currently overloaded. Please try again later.')
                        );
-                       exit;
                }
 
                if (strstr($this->query_string, '.well-known/host-meta') && ($this->query_string != '.well-known/host-meta')) {
-                       echo Module\Special\HTTPException::rawContent(
+                       Module\Special\HTTPException::rawContent(
                                new HTTPException\NotFoundException()
                        );
-                       exit;
                }
 
                if (!$this->getMode()->isInstall()) {
@@ -1082,10 +1046,9 @@ class App
                                        // Someone came with an invalid parameter, maybe as a DDoS attempt
                                        // We simply stop processing here
                                        Core\Logger::log("Invalid ZRL parameter " . $_GET['zrl'], Core\Logger::DEBUG);
-                                       echo Module\Special\HTTPException::rawContent(
+                                       Module\Special\HTTPException::rawContent(
                                                new HTTPException\ForbiddenException()
                                        );
-                                       exit;
                                }
                        }
                }
@@ -1206,11 +1169,6 @@ class App
                        }
                }
 
-               // Then we try name-matching a Friendica\Module class
-               if (!$this->module_class && class_exists('Friendica\\Module\\' . ucfirst($this->module))) {
-                       $this->module_class = 'Friendica\\Module\\' . ucfirst($this->module);
-               }
-
                /* Finally, we look for a 'standard' program module in the 'mod' directory
                 * We emulate a Module class through the LegacyModule class
                 */
@@ -1276,8 +1234,7 @@ class App
                        Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
                        call_user_func([$this->module_class, 'afterpost']);
                } catch(HTTPException $e) {
-                       echo Module\Special\HTTPException::rawContent($e);
-                       exit;
+                       Module\Special\HTTPException::rawContent($e);
                }
 
                $content = '';