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

Uploaded files with ampersand in name can't be deleted or renamed #88

Open
mitnosirrag opened this issue Sep 29, 2016 · 0 comments · May be fixed by #149
Open

Uploaded files with ampersand in name can't be deleted or renamed #88

mitnosirrag opened this issue Sep 29, 2016 · 0 comments · May be fixed by #149

Comments

@mitnosirrag
Copy link

Uploaded files with an ampersand (&) in their name fail to rename or delete.

To recreate for deletion:

  1. Upload an image with an ampersand (&) in the title
  2. Try to delete the image
  3. The image is reported as having been deleted, but remains in the system

To recreate for renaming (file is called "pantry_&_kitchen.jpeg"):

  1. Upload an image with an ampersand (&) in the title
  2. Click the icon to rename the image
  3. Apply a new name and slick "submit"
  4. The following error appears:

IOError at /admin/media-library/rename/
[Errno 2] No such file or directory: u'/home/ubuntu/media/uploads/products/pantry_'

I fixed the deletion issue locally, it appears that tagging file.filename with |urlencode does the trick. I applied it to lines 89 and 101 in templates/filebrowser/include/filelisting.html and am able to delete images.

I haven't figured out how the query_string tag works to fix the encoding there, but it seems like the fix would need to be applied there and maybe in templates/filebrowser/rename.html.

@rapto rapto linked a pull request Jun 5, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant