Opened 11 years ago
Closed 10 years ago
#27495 closed defect (bug) (worksforme)
Multisite SVG uploads are served with incorrect mime/type
Reported by: | jhawksley | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Media | Keywords: | reporter-feedback close |
Focuses: | multisite | Cc: |
Description
wp-includes/ms-files.php returns [text/xml] for SVG files, not [image/svg], which breaks their display.
Attachments (1)
Change History (5)
#1
@
11 years ago
- Component changed from General to Media
- Focuses accessibility template performance removed
- Keywords reporter-feedback added
- Version changed from 3.8.1 to 3.0
#2
follow-up:
↓ 3
@
11 years ago
That is not the case. Even when setting mime type as image/svg, ms-files.php still sets the header as text/xml.
#3
in reply to:
↑ 2
@
11 years ago
- Keywords close added
Replying to jhawksley:
That is not the case. Even when setting mime type as image/svg, ms-files.php still sets the header as text/xml.
I could not reproduce this with the code from comment:1:ticket:20990.
ms-files.php
uses wp_check_filetype()
and falls back to mime_content_type()
:
tags/3.8.2/src/wp-includes/ms-files.php#L32.
If the correct image/svg+xml
type is added via upload_mimes
filter, then wp_check_filetype()
returns that.
Otherwise, mime_content_type()
is used, which depends on server configuration (see comment:10:ticket:25224).
This appears to be a duplicate of #24251 and #26256. See also #25224 and #26591.
Thanks for the report jhawksley, and sorry nobody has gotten back to you until now.
By default, WordPress does not allow SVG files to be uploaded for security reasons. Are you running a plugin which enables SVG files to be uploaded?
If so, it should be hooking into the
upload_mimes
filter and adding thetext/xml
mime type in there. Can you confirm whether this is the case please?