Skip to content
Snippets Groups Projects
Commit 321b502b authored by Frode Petterson's avatar Frode Petterson
Browse files

JI-2080 Fix array post data not making it

parent 4b220ed7
No related branches found
No related tags found
No related merge requests found
......@@ -174,8 +174,8 @@ class framework implements \H5PFrameworkInterface {
continue; // Skip empty values
}
if (is_array($value)) {
foreach ($value as $subvalue) {
$curldata[$key . '[]'] = $subvalue;
foreach ($value as $i => $subvalue) {
$curldata["{$key}[{$i}]"] = $subvalue;
}
} else {
$curldata[$key] = $value;
......@@ -188,7 +188,7 @@ class framework implements \H5PFrameworkInterface {
} else if (is_array($file['name'])) {
// Array of files uploaded (multiple)
for ($i = 0; $i < count($file['name']); $i ++) {
$curldata[$name . '[]'] = new \CurlFile($file['tmp_name'][$i], $file['type'][$i], $file['name'][$i]);
$curldata["{$name}[{$i}]"] = new \CurlFile($file['tmp_name'][$i], $file['type'][$i], $file['name'][$i]);
}
} else {
// Single file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment