]> git.mxchange.org Git - friendica.git/commitdiff
Fix redirects
authorPhilipp <admin@philipp.info>
Tue, 27 Dec 2022 19:08:33 +0000 (20:08 +0100)
committerPhilipp <admin@philipp.info>
Tue, 27 Dec 2022 19:08:33 +0000 (20:08 +0100)
src/BaseModule.php

index 12efbce81170b476918e9a922453f37aa179db24..11f884472e65c448c774d6b8f1576ef986903bac 100644 (file)
@@ -243,6 +243,14 @@ abstract class BaseModule implements ICanHandleRequests
                        $this->response->addContent($arr['content']);
                        $this->response->addContent($this->content($request));
                } catch (HTTPException $e) {
+                       // In case of System::externalRedirects(), we don't want to prettyprint the exception
+                       // just redirect to the new location
+                       if (($e instanceof HTTPException\FoundException) ||
+                               ($e instanceof HTTPException\MovedPermanentlyException) ||
+                               ($e instanceof HTTPException\TemporaryRedirectException)) {
+                               throw $e;
+                       }
+
                        $this->response->addContent($httpException->content($e));
                } finally {
                        $this->profiler->set(microtime(true) - $timestamp, 'content');