diff --git a/typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php b/typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php index 61a3b72234da..fb9e6e000057 100644 --- a/typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php +++ b/typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php @@ -13,14 +13,15 @@ * * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Controller\ErrorPageController; use TYPO3\CMS\Core\Messaging\AbstractMessage; use TYPO3\CMS\Core\Utility\GeneralUtility; /** - * A quite exception handler which catches but ignores any exception. - * - * This file is a backport from FLOW3 + * An exception handler which catches any exception and + * renders an error page without backtrace (Web) or a slim + * message on CLI. */ class ProductionExceptionHandler extends AbstractExceptionHandler { @@ -98,11 +99,11 @@ protected function discloseExceptionInformation(\Throwable $exception) if ($exception instanceof Http\AbstractClientErrorException) { return true; } - // Only show errors in FE, if a BE user is authenticated - if (TYPO3_MODE === 'FE') { - return $GLOBALS['TSFE']->isBackendUserLoggedIn(); + // Only show errors if a BE user is authenticated + if ($GLOBALS['BE_USER'] instanceof BackendUserAuthentication) { + return $GLOBALS['BE_USER']->user['uid'] > 0; } - return true; + return false; } /**