Actions
Bug #94378
closedPHP Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/public/typo3/sysext/core/Classes/Utility/ArrayUtility.php line 297
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
Start date:
2021-06-18
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:
Description
Related to https://forge.typo3.org/issues/90241
Inside \TYPO3\CMS\Core\Utility\ArrayUtility::setValueByPath() no type check is executed when working with arrays.
This can lead to the PHP warning "array_key_exists() expects parameter 2 to be array".
Example call causing the warning:
\TYPO3\CMS\Core\Utility\ArrayUtility::setValueByPath(
[
'foo' => [
'bar' => null,
],
],
'foo/bar/baz',
123
);
The expected behaviour would be to not throw a \TYPO3\CMS\Core\Error\Exception.
Updated by Netresearch DTT GmbH over 3 years ago
- Related to Bug #90241: ArrayUtility "array_key_exists() expects parameter 2 to be array" added
Updated by Netresearch DTT GmbH over 3 years ago
Add
is_array($pointer) &&
check in
main/app/public/typo3/sysext/core/Classes/Utility/ArrayUtility.php:292
Updated by Netresearch DTT GmbH over 3 years ago
Updated by Christian Kuhn over 3 years ago
- Is duplicate of Task #94379: Fixed missing is_array check in setValueByPath added
Updated by Christian Kuhn over 3 years ago
- Status changed from New to Closed
closing as dupe of #94379
Actions