最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

SVG Upload to WordPress Issue

programmeradmin3浏览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?

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?

Share Improve this question edited Apr 29, 2020 at 22:28 Anthony Valentine asked Apr 29, 2020 at 20:56 Anthony ValentineAnthony Valentine 53 bronze badges 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 Commented 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. – Anthony Valentine Commented Apr 29, 2020 at 22:35
  • Are your client's sites part of a multisite with your site? – Jacob Peattie Commented Apr 30, 2020 at 0:23
  • Unfortunately, no. – Anthony Valentine Commented Apr 30, 2020 at 1:53
  • Maybe they are all using the same theme directory. Otherwise it can't happen. – fuxia Commented Apr 30, 2020 at 2:49
 |  Show 1 more comment

1 Answer 1

Reset to default 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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论