We try to allow svg uploads for image fields. But it's not configurable.
Wherever we add 'svg' to the list of allowed file extension on an image field it is never shown in the (node/paragraph/whatever) form. Only the default image file types are shown in the list below the field and upload of svg does not work. (like expected).

The patch you've included to the lightning profile was applied successfully, i've double checked the code.

Any ideas?

Comments

Jehu created an issue. See original summary.

phenaproxima’s picture

Can you provide some steps to reproduce?

phenaproxima’s picture

Status: Active » Closed (won't fix)

It turns out that this is an intentional security decision in core, and not specific to Lightning. It's going to take some fairly involved work to properly support SVG in core, because of the security implications; Lightning, for its part, will not venture far off the reservation because we do not want to play fast and loose with security hazards.

I filed a core issue, with a patch, to improve the UX around SVG uploads a bit: #2867494: File and image widgets are misleading about the extensions they accept

Other related issues:

#1014816: Allow image fields to use any extensions the current image toolkit supports (instead of hard-coding jpg, png and gif only)
#2868079: Sanitize OR add Content-Security-Policy for SVGs

Lightning will adapt its SVG support as it evolves in core. Therefore, except for bringing in the aforementioned patches once they land in core, I'm not sure what else we can do in this issue except close it.