Skip to content

Retain full path of files for directory uploads #6917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 14, 2021

Conversation

bjoern-tantau
Copy link
Contributor

To fix https://bugs.php.net/bug.php?id=77372 and improve support of <input type="file" name="files" multiple webkitdirectory> I introduced another item to the $_FILES array called fullpath, containing the full filename, as supplied by the user-agent.

bjoern-tantau pushed a commit to bjoern-tantau/php-src that referenced this pull request Apr 27, 2021
@nikic
Copy link
Member

nikic commented May 6, 2021

This looks reasonable to me. Main thing this needs is a rebase to drop the changes that are already on master, and a dedicated test for the new functionality. You've already updated plenty of tests that can serve as a template -- the POST_RAW section for a new test should be based on capturing what the browser actually sends in the multiple webkitdirectory case.

As a bit of bikeshed, should this be full_path rather than fullpath (in line with tmp_name)?

@cmb69 As you commented on the bug report, any opinion on this?

@cmb69
Copy link
Member

cmb69 commented May 6, 2021

Adding a new array member is fine for me. There is still the issue that IE provides the full path for single files, but that isn't a PHP issue when using a new member, and apparently can be disabled anyway. Besides that IE users likely have more serious issues.

@bjoern-tantau
Copy link
Contributor Author

This looks reasonable to me. Main thing this needs is a rebase to drop the changes that are already on master, and a dedicated test for the new functionality. You've already updated plenty of tests that can serve as a template -- the POST_RAW section for a new test should be based on capturing what the browser actually sends in the multiple webkitdirectory case.

As a bit of bikeshed, should this be full_path rather than fullpath (in line with tmp_name)?

Done. I've renamed it to full_path (and updated MAX_SIZE_OF_INDEX), added a test and rebased on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants