X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseModule.php;h=d9c7da97a7b8d3c6b30a97f682d51f1598aaf34e;hb=6394bd91c0f25d9e2c61ca6166a78e9563506554;hp=e532b95362dfc150d3e360be40b306c165af5170;hpb=e198edf652479bd0a969b3aabb469361dba0fd6b;p=friendica.git diff --git a/src/BaseModule.php b/src/BaseModule.php index e532b95362..d9c7da97a7 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -1,6 +1,6 @@ args->getQueryString(), 0, 12) == '.well-known/') { @@ -243,7 +243,15 @@ abstract class BaseModule implements ICanHandleRequests $this->response->addContent($arr['content']); $this->response->addContent($this->content($request)); } catch (HTTPException $e) { - $this->response->addContent((new ModuleHTTPException())->content($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'); } @@ -389,7 +397,7 @@ abstract class BaseModule implements ICanHandleRequests public static function getFormSecurityStandardErrorMessage(): string { - return DI::l10n()->t("The form security token was not correct. This probably happened because the form has been opened for too long \x28>3 hours\x29 before submitting it.") . EOL; + return DI::l10n()->t("The form security token was not correct. This probably happened because the form has been opened for too long \x28>3 hours\x29 before submitting it."); } public static function checkFormSecurityTokenRedirectOnError(string $err_redirect, string $typename = '', string $formname = 'form_security_token')