WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 5 months ago

#33713 new defect (bug)

Customizer: allowing to set files other than image for Header background and background image

Reported by: umesh.nevase Owned by:
Milestone: Priority: normal
Severity: major Version: 4.3
Component: Customize Keywords: needs-patch
Focuses: ui, javascript Cc:
PR Number:

Description

When we set header background image or background image from customizer settings, media upload should not allow to upload files other than image.

We can set files other than image, and it shows broken in preview

Attachments (1)

big-fix.33713.diff (2.0 KB) - added by jagnew 4 years ago.
Possible solution

Download all attachments as: .zip

Change History (10)

#1 @umesh.nevase
4 years ago

  • Component changed from General to Administration
  • Keywords needs-patch dev-feedback added
  • Severity changed from normal to major

#2 @umesh.nevase
4 years ago

  • Keywords dev-feedback removed

#3 @umesh.nevase
4 years ago

  • Component changed from Administration to Customize
  • Focuses accessibility added

#4 @afercia
4 years ago

  • Focuses accessibility removed

Thanks @umesh.nevase, just reproduced on trunk, followed steps:

Customizer > Header Image > Add new image > uploaded a .txt file in the "drop zone"

the .txt file is uploaded and I'm given the ability to "select and crop" it :)

https://cldup.com/1Gyq_SFzfq.jpg

Pressing the "Select and Crop" button brings me to the "Crop Image" view which shows a broken image placeholder. No error messages in the console.

Removing the "accssibility" keyword, definitely something worth having a look at though. cc @wonderboymusic

@jagnew
4 years ago

Possible solution

#5 @jagnew
4 years ago

Possible solution. However, there is two areas that could be improved:

1) Having to set the filter in both two places in the customize-controls.js
2) Hardcoding the image type extensions

Anyway first time contributing, so always up for learning. Thanks :)

#6 @celloexpressions
4 years ago

This should probably be addressed more generically in the media component. Essentially the issue is that if the context of the library is set to a specific mime type, the uploader should also restrict accordingly, or there should otherwise be some error reporting.

#7 @celloexpressions
4 years ago

#33415 was marked as a duplicate.

#8 @ocean90
3 years ago

  • Milestone changed from Awaiting Review to Future Release

Previously: #22149

#9 @ocean90
3 years ago

#36844 was marked as a duplicate.

Note: See TracTickets for help on using tickets.