Bug #97888
closedUndefined array key access in LogManager
100%
Description
The \TYPO3\CMS\Core\Log\LogManager::getConfigurationForLogger()
method accesses $GLOBALS['TYPO3_CONF_VARS']['LOG']
without checking if it really exists. Any array access should be hardened, considering PHP 8+.
It may seem unlikely that $GLOBALS['TYPO3_CONF_VARS']['LOG']
should be empty, but you never know. In my case, it happened when writing unit tests for a class which uses the LoggerAwareTrait
. The Logger gets instantiated and thus tries to access the corresponding configuration, which doesn't exist when unit testing.
Updated by Gerrit Code Review over 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75092
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/75068
Updated by Anonymous over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 07498c116a7236256b33b46f288881b4278eb859.