Project

General

Profile

Actions

Bug #94378

closed

PHP 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

Added by Netresearch DTT GmbH almost 3 years ago. Updated almost 3 years ago.

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #90241: ArrayUtility "array_key_exists() expects parameter 2 to be array"ClosedDaniel Siepmann2020-01-29

Actions
Is duplicate of TYPO3 Core - Task #94379: Fixed missing is_array check in setValueByPathClosed2021-06-18

Actions
Actions #1

Updated by Netresearch DTT GmbH almost 3 years ago

  • Related to Bug #90241: ArrayUtility "array_key_exists() expects parameter 2 to be array" added
Actions #2

Updated by Netresearch DTT GmbH almost 3 years ago

Add

is_array($pointer) &&

check in

main/app/public/typo3/sysext/core/Classes/Utility/ArrayUtility.php:292
Actions #4

Updated by Christian Kuhn almost 3 years ago

  • Is duplicate of Task #94379: Fixed missing is_array check in setValueByPath added
Actions #5

Updated by Christian Kuhn almost 3 years ago

  • Status changed from New to Closed

closing as dupe of #94379

Actions

Also available in: Atom PDF