[BUGFIX] Empty array not encoded as empty XML tag 01/44601/5
authorAndreas Wolf <dev@a-w.io>
Sat, 7 Nov 2015 16:04:32 +0000 (17:04 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 15 Nov 2015 11:22:02 +0000 (12:22 +0100)
commit746c162cdb31b6ee7f1824fd7483013eef31e088
tree23f38d0e2c60bfee859bb913bab7c765d98b5205
parentdbeaf26316e887276c04edc2275ea91d711e18b8
[BUGFIX] Empty array not encoded as empty XML tag

When encoding an empty array, an empty line with indentation was
created. If the <el> tag had a proper type="array" attribute, it could
still be decoded to an array again. If not, it was decoded to a string,
leading to errors e.g. when trying to traverse it.

The fix is to include an empty element now, which will be decoded to
an empty array again then.

Change-Id: Ia78adc1e7e81a943cdbc94f3cfa19b36442c430f
Resolves: #71394
Releases: 6.2, master
Reviewed-on: https://review.typo3.org/44601
Reviewed-by: Daniel Lorenz <forge@extco.de>
Tested-by: Daniel Lorenz <forge@extco.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
21 files changed:
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-in-ff.xml
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item.xml
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/irre-records.xml
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-rte-image-n-file-link.xml
typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent.xml
typo3/sysext/impexp/Tests/Functional/Import/GroupFileAndFileReferenceItem/ImportExportXml/impexp-group-file-and-file_reference-item-on-pid-zero.xml
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/ImportExportXml/pages-and-ttcontent-with-existing-different-image.xml
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/ImportExportXml/pages-and-ttcontent-with-existing-same-image.xml
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/ImportExportXml/pages-and-ttcontent-with-image-with-forced-uids.xml
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/ImportExportXml/pages-and-ttcontent-with-image-with-spaces-in-path.xml
typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/ImportExportXml/pages-and-ttcontent-with-image-without-storage.xml
typo3/sysext/impexp/Tests/Functional/ImportFromVersionFourDotFive/GroupFileAndFileReferenceItem/ImportExportXml/impexp-group-file-and-file_reference-item.xml
typo3/sysext/impexp/Tests/Functional/ImportFromVersionFourDotFive/GroupFileAndFileReferenceItemInFlexForm/ImportExportXml/impexp-group-file-and-file_reference-item-in-ff.xml
typo3/sysext/impexp/Tests/Functional/ImportFromVersionFourDotFive/PagesAndTtContent/ImportExportXml/pages-and-ttcontent.xml
typo3/sysext/impexp/Tests/Functional/ImportFromVersionFourDotFive/PagesAndTtContentUploads/ImportExportXml/pages-and-ttcontent-uploads.xml
typo3/sysext/impexp/Tests/Functional/ImportFromVersionFourDotFive/PagesAndTtContentWithImages/ImportExportXml/pages-and-ttcontent-with-images.xml
typo3/sysext/impexp/Tests/Functional/ImportFromVersionFourDotFive/PagesAndTtContentWithRteImagesAndFileLink/ImportExportXml/pages-and-ttcontent-with-rte-image-n-file-link.xml
typo3/sysext/impexp/Tests/Functional/ImportFromVersionFourDotFive/PagesWithLanguageOverlay/ImportExportXml/pages-and-pages-language-overlay.xml