X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseModule.php;h=619095dfb6fbaf019c669c309cc07c6fece29ec9;hb=e1863951986ba5be173758324a00652bc5af870c;hp=12efbce81170b476918e9a922453f37aa179db24;hpb=4f1bb0d274f3a28ca6513184bc21a98b8c32fe56;p=friendica.git diff --git a/src/BaseModule.php b/src/BaseModule.php index 12efbce811..619095dfb6 100644 --- a/src/BaseModule.php +++ b/src/BaseModule.php @@ -1,6 +1,6 @@ l10n->tt($singular, $plurarl, $count); + return $this->l10n->tt($singular, $plural, $count); } /** @@ -243,6 +243,15 @@ 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->setStatus($e->getCode(), $e->getMessage()); $this->response->addContent($httpException->content($e)); } finally { $this->profiler->set(microtime(true) - $timestamp, 'content');