This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
[BUG] This fix allows the upload of same filenames in input type file #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For example, Safari on IOS gives the name image.jpg for pictures from the gallery
In the present situation, the first files would be overriden by the last file with the same name.
And the getValue of these inputs will return the same fileName with no really mean to identify it.
With the use of the unique name from PHP $_FILES in the name column of the $_files array of the Http adapter, the files will be unique and easily identifiable.
I have adjusted the unit test for the File/Transfer/Adapter/HttpTest::testMultiFiles() method and added one for a same name case.
First, the $_FILES is mocked with the implication that the "name" value can be a path with more than one directory. Shouldn't it be only a filename like picture.jpg, document.docx or script.php ?
Secondly, the "tmp_name" value doesn't seem to be mocked properly, or the format %TMP_DIRECTORY%/php123456 can be overriden ?
Codisart