Bug #71394
closedGeneralUtility::array2xml(): Empty arrays are encoded as whitespace
100%
Description
When encoding an empty array as XML (e.g. an empty Flexform container from which all sections have been removed), the empty array will be encoded as (linebreaks stripped) <el index="el"> </el>
. This leads to the object not being treated as an empty array on decoding, but as a nonempty string.
In some situations, such a non-empty string leads to undesirable results, e.g. when passing it to Fluid’s f:for
view helper, where it will trigger a warning because it is not iterable.
The root cause can be found in GeneralUtility::array2xml(), where the value of array elements is prepended with indentation no matter the size of the array. Instead, empty elements should be dropped.
In most situations, the type="array"
will mitigate the negative effects. For certain Flexform constellations however, this will not be used, making it impossible to resolve the type properly.
Updated by Gerrit Code Review about 9 years ago
- Status changed from Accepted 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/44599
Updated by Gerrit Code Review about 9 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/44599
Updated by Gerrit Code Review about 9 years ago
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/44600
Updated by Anonymous about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9b4e2e5ed4020e54bf8fc397b7bb5b3f6b9e4dbd.
Updated by Gerrit Code Review about 9 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44601
Updated by Gerrit Code Review about 9 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/44600
Updated by Anonymous about 9 years ago
- Status changed from Under Review to Resolved
Applied in changeset 9da6bd15deb0595bb2b57b216dbdb9202963f40e.
Updated by Gerrit Code Review about 9 years ago
- Status changed from Resolved to Under Review
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44601
Updated by Gerrit Code Review about 9 years ago
Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44601
Updated by Gerrit Code Review about 9 years ago
Patch set 4 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/44601
Updated by Anonymous about 9 years ago
- Status changed from Under Review to Resolved
Applied in changeset 746c162cdb31b6ee7f1824fd7483013eef31e088.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed