Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 6 years ago

#31973 closed enhancement (duplicate)

Add SVG upload and media gallery support

Reported by: lewiscowles's profile LewisCowles Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Media Keywords:
Focuses: ui, accessibility, administration Cc:


This plugin adds SVG upload and Gallery support (not just for limited modes, all has been tested).

UI fixes / updates, accessibility enabling ia SVG accessibility capability.

Attachments (1)

wordpress-svg.patch (2.1 KB) - added by LewisCowles 8 years ago.
SVG patch for functions.php and media-template.php in wp-includes fixes svg display and enables upload of SVG by default

Download all attachments as: .zip

Change History (8)

8 years ago

SVG patch for functions.php and media-template.php in wp-includes fixes svg display and enables upload of SVG by default

#1 @SergeyBiryukov
8 years ago

  • Component changed from General to Media
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @LewisCowles, thanks for the ticket and the patch.

This is a duplicate of another ticket, #31258. Could you please add your patch there?

#2 follow-up: @LewisCowles
8 years ago

Thanks Sergey, added, but I disagree they are at all the same. Mine not only modifies the media-templates.php, it also adds upload support (and fixes grid, which the other does not), but now it is in both so we are both happy? ;)

Also do you have the power to approve or reject the patch? :p gotta ask

#3 in reply to: ↑ 2 @ocean90
8 years ago

Replying to LewisCowles:

it also adds upload support

That's handled in #24251.

#4 @LewisCowles
8 years ago

Hi, Upload support without media gallery is useless! Media gallery support for SVG, without upload support is useless! Do you see my point?

In any case, an interesting read. I submitted this, because I cannot believe WordPress core does not support SVG, and I did not want to have to bundle a plugin to clients wanting to use modern file formats.

Sanitizing authorized user upload and input is a problem! It is not a feature, nor a benefit; it is most certainly not an improvement! It's like not letting a kid outside because they could hurt themselves or others, based on the fact they have hands, and hands can hold sharp pointy things...

I will submit my media edits to #31258 without upload, as well, as it does fix the grid issue, but I disagree that it is prudent or necesarry to separate them on anything but an academicly shaky premise.

I hope you can understand my passion and the point I am trying to make.

Sure not easy making WordPress any better.

#5 @hendridm
6 years ago

I agree with Lewis - there are safe and proven* ways to allow SVG support in WordPress. I feel like the war on SVG is a bit outdated.


#6 @LewisCowles
6 years ago

@hendridm btw if there are modifications needed to to make it compatible with other plugins that would hook upload process and provide security concerns, I'm all for that, as it can be turned off independently to improve cases for businesses not just "downloading and hoping" on third-party untrusted media.

I never knew SVG couldn't be uploaded, or was non-trivial until Chris Coyier wrote an article that I thought seemed absurd at first glance and seemed to me to highlight "areas for improvement". WordPress was not just not supporting, but was fundamentally hostile to SVG, and seems to have continued to be with design decisions.

That is where a lot of the passionate discourse on this came from and remains from. It's one thing to not whitelist extensions. I do feel like this is now part of a larger set of concerns than SVG.

#7 @hendridm
6 years ago

I'm not exactly sure what you're suggesting, but yours is working great with my own media offloader plugin.

The "Safe SVG" plugin does not work with mine - ajax returns some 500 error when uploading to media library). I haven't tried it with the other popular "SVG Support" plugin yet as my own plugin is still in alpha stage.

Note: See TracTickets for help on using tickets.