Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Nested uploaded files parsed wrong in 1.8.0 #311

Closed
aimeos opened this issue Jul 8, 2018 · 2 comments
Closed

Nested uploaded files parsed wrong in 1.8.0 #311

aimeos opened this issue Jul 8, 2018 · 2 comments

Comments

@aimeos
Copy link

aimeos commented Jul 8, 2018

There's a problem in 1.8.0 with nested file uploads for e.g.:

<input type="file" name="image[0][file]" />

Then, createUploadedFile() is called with that array:

Array (
	[image] => Array (
		[name] => Array ( [0] => Array ( [file] => admin-product-detail.png ) )
		[type] => Array ( [0] => Array ( [file] => image/png ) )
		[tmp_name] => Array ( [0] => Array ( [file] => /tmp/php9tIgbR ) )
		[error] => Array ( [0] => Array ( [file] => 0 ) )
		[size] => Array ( [0] => Array ( [file] => 83760 ) ) 
	) 
)

In version 1.7.2 nested files are correctly parsed

@precariouspanther
Copy link
Contributor

Noticed this too - diactoros is allowing single dimension arrays of files (i.e image[0]) and named indexes (i.e image[my-image]) but not multi-dimensional arrays (i.e image[0][file], image[slide][0][image][4]) which are legal names for file upload elements.

@precariouspanther
Copy link
Contributor

Candidate fix PR here: #312

precariouspanther pushed a commit to precariouspanther/zend-diactoros that referenced this issue Jul 9, 2018
weierophinney pushed a commit to precariouspanther/zend-diactoros that referenced this issue Jul 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants