Project

General

Profile

Actions

Bug #22568

closed

simple value cannot overwrite array value in "t3lib_div::array_merge_recursive_overrule"

Added by Mikkel Ricky almost 14 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-05-02
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Only array values can overwrite array values in "t3lib_div::array_merge_recursive_overrule", i.e. if the first array contains a key with an array value and the second array contains the same key with a simple value then the value of the key in result will be the array value from the first array.

Steps to reproduce:

$arr0 = array(0 => array());
$arr1 = array(0 => 0);
$expected = array(0 => 0);
$actual = t3lib_div::array_merge_recursive_overrule($arr0, $arr1);

Now

$actual === array(0 => array())

but should be

$actual === array(0 => 0)

Applies to all versions of TYPO3.

(issue imported from #M14280)


Files

array_merge_recursive_overrule.patch (831 Bytes) array_merge_recursive_overrule.patch Administrator Admin, 2010-05-02 19:14
Actions #1

Updated by Chris topher almost 14 years ago

Hi Mikkel,

thanks for your work to improve TYPO3!

Do you know, that you should now send your patch to the TYPO3 Core List?
Check out http://typo3.org/teams/core/core-mailinglist-rules/

Actions #2

Updated by Alexander Opitz almost 11 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)

The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?

Actions #3

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to Closed
  • Is Regression set to No

No feedback for over 90 days.

Actions #4

Updated by Kasper Ligaard over 10 years ago

Hi Mikkel.

If you are on PHP 5.3+ then you could probably use the PHP function array_replace_recursive().

Regards, Kasper

Actions

Also available in: Atom PDF