[BUGFIX] Check if `$rows` is an array before iteration 11/48311/6
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 27 May 2016 08:59:26 +0000 (10:59 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 27 May 2016 10:29:43 +0000 (12:29 +0200)
commit485bbc5307c195ca93ea8d7621db08c72f6739a2
treef1cb23712f9ff5b56204d617891145ccecf25475
parent0c3a1178b64a9f9d748aa59b883d1308a92436f2
[BUGFIX] Check if `$rows` is an array before iteration

In case `$rows` in the method `DataHandler::copySpecificPage()` is null,
the foreach loop will throw an error.
`$rows` may become null if an extension brings TCA but the table does not
have `uid` field, for example.

It's now checked whether the result being iterated is an array, otherwise
an error is logged.

Resolves: #74125
Releases: master, 7.6
Change-Id: I20cb101155632309b9e08600fcd33e655c1c9d2f
Reviewed-on: https://review.typo3.org/48311
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php