ImageSelector allowed to upload svg even though allowContentType media:image

Enonic version: 6.7
OS: Mac and Linux

The ImageSelector is nice because you are allowed to upload images.

This particular part does not and is not supposed to support svg’s so I’ve added:
<allowContentType>media:image</allowContentType>

You are however allowed to upload svg files, and the allowContentType config is “side stepped”.
So the svg becomes the selected content.

Which of course turns the part into a nice red screen.

Maybe it’s possible to limit which extensions to show in the file selector.
Or simply not make uploaded content “selected” if it does not match the allowContentType.

The ImageSelector input type does not support the <allowContentType> config.
Only ContentSelector does.

It does work though.

When I added media:image svgs no longer appears in the list of content to select.

Yes, I see that. I think that is actually a bug :slight_smile:
It was not supposed to work for ImageSelector, it only makes sense to allow "media:image" and "media:vector" (bitmap images + svg)

So I guess I want ImageSelector with denyContentType “media:vector” :wink:

1 Like

Seems like something is broken here we’ll investigate!
Something that does more than it should - now I’ve seen that too :slight_smile: