Multi-extension validation failure should show a helpful validation message #1210

Closed
opened 2026-02-05 00:16:01 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @br0p0p on GitHub (May 30, 2019).

Describe the bug
When uploading an image with a filename like Screen Shot 2019-05-22 at 3.54.06 PM.png, the request fails with status 422 and response {"file":["The file must only have a single file extension."]}

Steps To Reproduce
Steps to reproduce the behavior:

  1. Create a new page or edit an existing page.
  2. Click the "Insert an image" button.
  3. Browse to a file named something like Screen Shot 2019-05-22 at 3.54.06 PM.png or something with periods before the extension.

Expected behavior
The image should be uploaded and I should be able to select it from the image grid on the left.

Screenshots
It looks like the upload completes but it never shows up in the group of images to the left:
Screen Shot 2019-05-30 at 11 32 22 AM

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): v0.26.1
  • PHP Version: 7.2.3
  • Hosting Method (Nginx/Apache/Docker): IIS
Originally created by @br0p0p on GitHub (May 30, 2019). **Describe the bug** When uploading an image with a filename like `Screen Shot 2019-05-22 at 3.54.06 PM.png`, the request fails with status 422 and response `{"file":["The file must only have a single file extension."]}` **Steps To Reproduce** Steps to reproduce the behavior: 1. Create a new page or edit an existing page. 2. Click the "Insert an image" button. 3. Browse to a file named something like `Screen Shot 2019-05-22 at 3.54.06 PM.png` or something with periods before the extension. **Expected behavior** The image should be uploaded and I should be able to select it from the image grid on the left. **Screenshots** It looks like the upload completes but it never shows up in the group of images to the left: <img width="293" alt="Screen Shot 2019-05-30 at 11 32 22 AM" src="https://user-images.githubusercontent.com/657922/58648289-07ab0380-82cf-11e9-8b7c-cbd164b0be7f.png"> **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): `v0.26.1` - PHP Version: 7.2.3 - Hosting Method (Nginx/Apache/Docker): IIS
OVERLORD added the 🛠️ Enhancement💆 UX labels 2026-02-05 00:16:01 +03:00
Author
Owner

@JtheBAB commented on GitHub (May 31, 2019):

This is due to the new security system in 0.25.X

https://www.bookstackapp.com/blog/beta-release-v0-25-5/

Bookstack think your photo has multiple extensions.

@JtheBAB commented on GitHub (May 31, 2019): This is due to the new security system in 0.25.X https://www.bookstackapp.com/blog/beta-release-v0-25-5/ Bookstack think your photo has multiple extensions.
Author
Owner

@br0p0p commented on GitHub (May 31, 2019):

Ok, so I take it this is something I'll have to work around by changing the file name. It would be helpful if the UI reflected this error or something when it happens.

@br0p0p commented on GitHub (May 31, 2019): Ok, so I take it this is something I'll have to work around by changing the file name. It would be helpful if the UI reflected this error or something when it happens.
Author
Owner

@ssddanbrown commented on GitHub (Jun 1, 2019):

Thanks @JtheBAB for explaining this one.

@br0p0p Yeah, I agree, I'll update the title of this issue to reflect the UI change that needs to be made.

@ssddanbrown commented on GitHub (Jun 1, 2019): Thanks @JtheBAB for explaining this one. @br0p0p Yeah, I agree, I'll update the title of this issue to reflect the UI change that needs to be made.
Author
Owner

@ssddanbrown commented on GitHub (Nov 24, 2021):

As of BookStack v21.04 and #2611 this is no longer relevant due to a different strategy being used in a multi-dot file-name scenario. Will therefore close this off.

@ssddanbrown commented on GitHub (Nov 24, 2021): As of BookStack v21.04 and #2611 this is no longer relevant due to a different strategy being used in a multi-dot file-name scenario. Will therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1210