[BUGFIX] Check if `$rows` is an array before iteration 15/48315/2
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:31:04 +0000 (12:31 +0200)
commit37a2a0563f1abf28cdd82320fc649b7c0ed89d6f
tree6b82aeaade0dec9c446a9643075371e48de4ae99
parent81cd2a083e4ffd33b8fb0ac906cf361459acd6a1
[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/48315
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php