Ensure tmpData exists

Otherwise you might get illegal string offset
This commit is contained in:
Thomas Portelange 2018-03-15 20:40:05 +01:00 committed by GitHub
parent d28a1b5cfc
commit 2e1c70b56c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1454,7 +1454,7 @@ class Form extends ViewableData implements HasRequestHandler
$tmpData = &$data[$name];
// drill down into the data array looking for the corresponding value
foreach ($keys as $arrayKey) {
if ($arrayKey !== '') {
if ($tmpData && $arrayKey !== '') {
$tmpData = &$tmpData[$arrayKey];
} else {
//empty square brackets means new array