Actions
Bug #79426
closedMethod traverseFlexFormXMLData in TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools crashes with runtime error
Start date:
2017-01-23
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
The following code will crash with an runtime-error if $dataStructureArray['sheets'] is not an array
// Traverse languages: foreach ($dataStructureArray['sheets'] as $sheetKey => $sheetData) { // Render sheet: if (is_array($sheetData['ROOT']) && is_array($sheetData['ROOT']['el'])) { $PA['vKeys'] = ['DEF']; $PA['lKey'] = 'lDEF'; $PA['callBackMethod_value'] = $callBackMethod_value; $PA['table'] = $table; $PA['field'] = $field; $PA['uid'] = $row['uid']; // Render flexform: $this->traverseFlexFormXMLData_recurse($sheetData['ROOT']['el'], $editData['data'][$sheetKey]['lDEF'], $PA, 'data/' . $sheetKey . '/lDEF'); } else { return 'Data Structure ERROR: No ROOT element found for sheet "' . $sheetKey . '".'; } }
It would ne nicer to add a check if $dataStructureArray is not an array and then return an error string
// Check if $dataStructureArray['sheets'] is indeed an array before loop or it will crash with runtime error if (!is_array($dataStructureArray['sheets'])) { return 'Data Structure ERROR: sheets is defined but not an array for table ' . $table . (isset($row['uid']) ? ' and uid ' . $row['uid'] : ''); }
Updated by Gerrit Code Review almost 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51399
Updated by Gerrit Code Review almost 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51399
Updated by Benni Mack almost 8 years ago
- Target version changed from 8.6 to 8 LTS
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51399
Updated by Thomas Hohn over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 76b645b7851aa5d1ae29cf4c9bb9b7bd48f92250.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed
Actions