72104[BUGFIX] Fix undefined array key errors in ContentObjectRenderer
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Nikita Hovratov +1
-
Verified V +2 Done
- Christian Kuhn +2
- Nikita Hovratov +1
- core-ci +1 CI
Issues 1
Files 1
Review log 1315
-
Chris Müller uploaded patch set 1 11/09/21, 19:10
-
core-ci voted on patch set 1 V +1 11/09/21, 19:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19084
-
Christian Kuhn voted on patch set 1 V +1 CR +1 11/09/21, 19:25
-
Nikita Hovratov voted on patch set 1 CR +1 11/09/21, 21:24
-
Oli Bartsch commented on patch set 1 11/09/21, 21:45
-
Christian Kuhn commented on patch set 1 11/09/21, 22:06
ContentObjectRenderer.php:5969Replyreally? even if that array key is accessed in the if-body? -
Chris Müller commented on patch set 1 11/10/21, 06:58
ContentObjectRenderer.php:5969ReplyHmm, after thinking about that: In principle, $conf[$property] can have the value "null" which is set and then throws a type error, as the 3rd argument of str_replace() must be a string or an array. So I think, this edge case is not covered, and should be like Oliver said. But don't know, if the value of a property can be null. -
Nikita Hovratov commented on patch set 1 11/10/21, 09:12
ContentObjectRenderer.php:5969Reply@Chris if $conf[$property] is set as null, isset would return false. This is the reason array key existance should be checked by array_key_exists instead (in general). But for this one what Oli means, is that before it was the truthy value of the array entry. Technically correct replacement would be: !empty($conf[$property]) or $conf[$property] ?? false We use the last one more often. People say it's faster than to call a function. -
Christian Kuhn commented on patch set 1 11/10/21, 10:12
ContentObjectRenderer.php:5969Replyso we update patch to use null coalescence? -
Nikita Hovratov uploaded patch set 2 11/10/21, 11:30
-
Nikita Hovratov commented on patch set 2 11/10/21, 11:30
ContentObjectRenderer.php:5969ReplyDone -
Nikita Hovratov voted on patch set 2 V +1 CR +1 11/10/21, 11:32
-
core-ci voted on patch set 2 V +1 11/10/21, 11:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/19121
-
Christian Kuhn voted on patch set 2 V +2 CR +2 11/10/21, 12:25
-
Christian Kuhn merged patch set 3 11/10/21, 12:25
ContentObjectRenderer.php:5969