Skip to content

Commit

Permalink
BUGFIX: 3585 Fusion Runtime @apply with integer indexed array
Browse files Browse the repository at this point in the history
starting with PHP 7.4 it's not cool to do offset access on integers (which returns null always)

I did a little digging, and we have this skip keys logic 3 times in the runtime (probably not extracted for performance reasons)

2 times this logic needs to be adjusted to only operate on strings. Those two snippets where introduced with neos#2738

And 1 time this logic already has an is_string check. https://github.com/neos/neos-development-collection/blob/046e5d02750af0ebf33cc52663799ce09683ba37/Neos.Fusion/Classes/Core/Runtime.php#L667
This was adjusted when 7.4 compatibility was introduced via neos#2804 but the other two references where not adjusted
  • Loading branch information
mhsdesign committed Oct 26, 2022
1 parent 046e5d0 commit 26b5204
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Neos.Fusion/Classes/Core/Runtime.php
Expand Up @@ -761,7 +761,7 @@ protected function evaluateApplyValues($configurationWithEventualProperties, $fu
$positionalArraySorter = new PositionalArraySorter($propertiesConfiguration, '__meta.position');
foreach ($positionalArraySorter->getSortedKeys() as $key) {
// skip keys which start with __, as they are purely internal.
if ($key[0] === '_' && $key[1] === '_' && in_array($key, Parser::$reservedParseTreeKeys, true)) {
if (is_string($key) && $key[0] === '_' && $key[1] === '_' && in_array($key, Parser::$reservedParseTreeKeys, true)) {
continue;
}

Expand All @@ -777,7 +777,7 @@ protected function evaluateApplyValues($configurationWithEventualProperties, $fu
if (is_array($singleApplyValues)) {
foreach ($singleApplyValues as $key => $value) {
// skip keys which start with __, as they are purely internal.
if ($key[0] === '_' && $key[1] === '_' && in_array($key, Parser::$reservedParseTreeKeys, true)) {
if (is_string($key) && $key[0] === '_' && $key[1] === '_' && in_array($key, Parser::$reservedParseTreeKeys, true)) {
continue;
}

Expand Down

0 comments on commit 26b5204

Please sign in to comment.