Merge branch 'fix-10796' into develop
This commit is contained in:
commit
fb0cf0f757
@ -1145,12 +1145,22 @@ class AdminProducts extends AdminTab
|
||||
|
||||
/* Adding new product images */
|
||||
elseif (isset($_FILES['image_product']['name']) && is_array($_FILES['image_product']['name'])) {
|
||||
|
||||
// ensure there is actually any file to process
|
||||
$has_any_file = false;
|
||||
foreach ($_FILES['image_product']['name'] as $value) {
|
||||
$has_any_file = $has_any_file || !empty($value);
|
||||
}
|
||||
if (!$has_any_file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$success = true;
|
||||
|
||||
// reorganise the array into an indexed array
|
||||
$images_product = [];
|
||||
for ($i=sizeof($_FILES['image_product']['error']); $i>0; $i--) {
|
||||
for ($i=sizeof($_FILES['image_product']['name']); $i>0; $i--) {
|
||||
|
||||
$images_product[] = [
|
||||
'name' => '',
|
||||
'type' => '',
|
||||
@ -1160,6 +1170,8 @@ class AdminProducts extends AdminTab
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($_FILES['image_product'] as $key => $array_values) {
|
||||
$i=0;
|
||||
foreach ($array_values as $value) {
|
||||
|
Loading…
Reference in New Issue
Block a user