Skip to content

Commit

Permalink
[BUGFIX] Always exclude E_USER_DEPRECATED from exceptionalErrors
Browse files Browse the repository at this point in the history
There is a limited use case for exceptions to be thrown
on deprecation messages. To ease the upgrade path to TYPO3 9
and to not allow "accidental" configuration that breaks the system,
deprecation messages will never throw exceptions.

Users with other use cases, can still implement and configure their
own exception handler.

Resolves: #84802
Releases: master
Change-Id: Iebbc2c201ba8bb68fa5725b90fba516d37d168be
Reviewed-on: https://review.typo3.org/56752
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>
  • Loading branch information
helhum committed Apr 21, 2018
1 parent 161ba9b commit f645597
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion typo3/sysext/core/Classes/Error/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ public function __construct($errorHandlerErrors)
*/
public function setExceptionalErrors($exceptionalErrors)
{
$this->exceptionalErrors = (int)$exceptionalErrors;
$exceptionalErrors = (int)$exceptionalErrors;
// We always disallow E_USER_DEPRECATED to generate exceptions as this may cause
// bad user experience specifically during upgrades.
$this->exceptionalErrors = $exceptionalErrors & ~E_USER_DEPRECATED;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ SYS:
description: 'The E_* constant that will be handled by the [SYS][errorHandler]. Not all PHP error types can be handled! Default is 30466 = <code>E_ALL & ~(E_STRICT | E_NOTICE | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR)</code> (see <a href="http://php.net/manual/en/errorfunc.constants.php" target="_blank">PHP documentation</a>).'
exceptionalErrors:
type: errors
description: 'The E_* constant that will be converted into an exception by the default [SYS][errorHandler]. Default is 4096 = <code>E_ALL & ~(E_STRICT | E_NOTICE | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR | E_DEPRECATED | E_USER_DEPRECATED | E_WARNING | E_USER_ERROR | E_USER_NOTICE | E_USER_WARNING)</code> (see <a href="http://php.net/manual/en/errorfunc.constants.php" target="_blank">PHP documentation</a>).'
description: 'The E_* constant that will be converted into an exception by the default [SYS][errorHandler]. Default is 4096 = <code>E_ALL & ~(E_STRICT | E_NOTICE | E_COMPILE_WARNING | E_COMPILE_ERROR | E_CORE_WARNING | E_CORE_ERROR | E_PARSE | E_ERROR | E_DEPRECATED | E_USER_DEPRECATED | E_WARNING | E_USER_ERROR | E_USER_NOTICE | E_USER_WARNING)</code> (see <a href="http://php.net/manual/en/errorfunc.constants.php" target="_blank">PHP documentation</a>). E_USER_DEPRECATED is always excluded to avoid exceptions to be thrown for deprecation messages.'
belogErrorReporting:
type: errors
description: 'Configures which PHP errors should be logged to the "syslog" database table (extension: belog). If set to "0" no PHP errors are logged to the sys_log table. Default is 30711 = <code>E_ALL & ~(E_STRICT | E_NOTICE)</code> (see <a href="http://php.net/manual/en/errorfunc.constants.php" target="_blank">PHP documentation</a>).'
Expand Down

0 comments on commit f645597

Please sign in to comment.