0

So I added this code to my Functions.php file and all of a sudden I can upload SVG's across my entire server, all my clients websites.

I know there are security disclaimers regarding using this code.

function cc_mime_types($mimes) {
 $mimes['svg'] = 'image/svg+xml';
 return $mimes;
}
add_filter('upload_mimes', 'cc_mime_types');

Anyone have any idea why this is possible for all my clients and not just the one website I put the code onto? Is this something I should be worried about?

6
  • I don't understand your question: First you say it's working for all clients, and then it's not? Please clarify. And welcome to WordPress Stack Exchange!
    – fuxia
    Apr 29, 2020 at 21:51
  • Yes, I'm new here! Thank you. I edited the question a bit. I just don't understand how I added the code to one website and now all of the sudden I can upload SVG's on every one of my websites across my server. Apr 29, 2020 at 22:35
  • Are your client's sites part of a multisite with your site? Apr 30, 2020 at 0:23
  • Unfortunately, no. Apr 30, 2020 at 1:53
  • Maybe they are all using the same theme directory. Otherwise it can't happen.
    – fuxia
    Apr 30, 2020 at 2:49

1 Answer 1

0

I've established this is a plugin/theme conflict. I will report back when I know more.

I tested this on a couple of my other client's websites that are on different servers but share similar themes/plugins, and sure enough, I can upload SVGs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.