Skip to content
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

Problem uploading files with invalid filenames #1202

Closed
sejas opened this issue Apr 5, 2024 · 0 comments · Fixed by #1228
Closed

Problem uploading files with invalid filenames #1202

sejas opened this issue Apr 5, 2024 · 0 comments · Fixed by #1228
Labels
[Type] Bug An existing feature does not function as intended

Comments

@sejas
Copy link
Collaborator

sejas commented Apr 5, 2024

@katinthehatsite found if you try to upload a file with dots followed by spaces in the filename it won't be recognized and the file will not be uploaded.

  • On Playground web it creates an "empty" file.
  • On wp-now it throws an error about
uploading-png-fails-playground.mp4

Steps to reproduce:

  1. Download this file, or rename any png/jpg file to contain some dots in the middle of the name, like 2024.04.05 fails.png
  2. Open https://playground.wordpress.net/
  3. Navigate to media
  4. Try uploading your file with conflictive name
  5. Observe the file is not uploaded

I would expect the files are uploaded to the WordPress site.
The mentioned files work fine on a regular WordPress installation.

@adamziel adamziel added the [Type] Bug An existing feature does not function as intended label Apr 11, 2024
@adamziel adamziel added this to the Zero Crashes milestone Apr 11, 2024
adamziel added a commit that referenced this issue Apr 11, 2024
Applies decodeURIComponent() to dispatched paths in PHPRequestHandler.

It solves the following problem: If you try to upload a file with dots followed by spaces in the filename it won't be recognized and the file will not be uploaded.

Closes #1202

 ## Testing instructions

* Go through steps from #1202
* Confirm the unit tests pass
adamziel added a commit that referenced this issue Apr 11, 2024
Applies decodeURIComponent() to dispatched paths in PHPRequestHandler.

It solves the following problem: If you try to upload a file with dots
followed by spaces in the filename it won't be recognized and the file
will not be uploaded.

Closes #1202

 ## Testing instructions

* Go through steps from #1202
* Confirm the unit tests pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants