Rock icon indicating copy to clipboard operation
Rock copied to clipboard

Image Browser allows uploads with invalid filenames

Open cabal95 opened this issue 6 years ago • 1 comments

Prerequisites

Description

I'm not sure if the issue is that the filename is allowed during upload - or if it's that the filename should be escaped when trying to insert. Either way, if you upload an image file named #1.png, it will allow the upload, it will show in preview, but when you try to insert it fails with a permission denied error because it's trying to load #1.png which is not a valid filename for web use.

If I manually change the filename to %231.png then it loads as expected.

Steps to Reproduce

  1. Generate a PNG with the filename #1.png
  2. Add an HTML block to a page.
  3. Edit content and switch to WYSIWIG mode.
  4. Click Image Browser button
  5. Upload #1.png
  6. Select #1.png for insert and notice "nothing happens".
  7. Click Image Browser button again.
  8. Open your Network Resources inspector tab.
  9. Select #1.png again and notice you get a 403 error trying to request that file.

Expected behavior:

I should either get an error about uploading that filename, or it should properly escape the filename.

Actual behavior:

Sad kitty face since I get a very confused user calling me asking why they can't insert that picture.

Versions

  • Rock Version: 7.3
  • Client Culture Setting: en-US

cabal95 avatar Aug 13 '18 18:08 cabal95

Confirmed on prealpha

mikejed avatar Aug 13 '18 22:08 mikejed