]> git.mxchange.org Git - friendica.git/commitdiff
Remove dreamhost_error_hack
authorArt4 <art4@wlabs.de>
Mon, 18 Nov 2024 08:53:09 +0000 (08:53 +0000)
committerArt4 <art4@wlabs.de>
Mon, 18 Nov 2024 08:53:09 +0000 (08:53 +0000)
This was introduced in commit 2c5ba7fc15b96016684f6c9e047144e10e8d7c46 but might never worked
because $dreamhost_error_hack was never defined

src/Module/HTTPException/PageNotFound.php

index 5450250c37298c23ff639acc4978d3578c2927c2..ffc49578794c4633724b392825c05f54dff7bb75 100644 (file)
@@ -37,26 +37,13 @@ class PageNotFound extends BaseModule
 
        public function run(ModuleHTTPException $httpException, array $request = []): ResponseInterface
        {
-               /* The URL provided does not resolve to a valid module.
-                *
-                * On Dreamhost sites, quite often things go wrong for no apparent reason and they send us to '/internal_error.html'.
-                * We don't like doing this, but as it occasionally accounts for 10-20% or more of all site traffic -
-                * we are going to trap this and redirect back to the requested page. As long as you don't have a critical error on your page
-                * this will often succeed and eventually do the right thing.
-                *
-                * Otherwise we are going to emit a 404 not found.
-                */
+               // The URL provided does not resolve to a valid module.
                $queryString = $this->server['QUERY_STRING'];
                // Stupid browser tried to pre-fetch our JavaScript img template. Don't log the event or return anything - just quietly exit.
                if (!empty($queryString) && preg_match('/{[0-9]}/', $queryString) !== 0) {
                        System::exit();
                }
 
-               if (!empty($queryString) && ($queryString === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
-                       $this->logger->info('index.php: dreamhost_error_hack invoked.', ['Original URI' => $this->server['REQUEST_URI']]);
-                       $this->baseUrl->redirect($this->server['REQUEST_URI']);
-               }
-
                $this->logger->debug('index.php: page not found.', [
                        'request_uri' => $this->server['REQUEST_URI'],
                        'address'     => $this->remoteAddress,