[wp-trac] [WordPress Trac] #11668: Attempt to detect the correct post enclosure mime type
WordPress Trac
wp-trac at lists.automattic.com
Tue Dec 29 23:13:20 UTC 2009
#11668: Attempt to detect the correct post enclosure mime type
-------------------------+--------------------------------------------------
Reporter: josephscott | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.0
Component: Feeds | Version: 2.9
Severity: normal | Keywords: has-patch
-------------------------+--------------------------------------------------
When looking for audio/video enclosures to add to new posts WP relies on
the hosting server (for the media file) to provide a useful/correct mime
type. Some servers will provide generic types (like binary/octet-stream)
instead of a more specific type. A common case is Amazon S3, which
defaults to binary/octet-stream. Not having a specific mime type (like
audio/mpeg instead of binary/octet-stream) will cause WP to miss what
would other wise be a valid feed enclosure item.
WP already has a list of common file extensions and their associated mime
type in the get_allowed_mime_types() function. We can compensate some
what for these non-specific mime types by comparing the file extension
with the list from get_allowed_mime_types().
I've put together a simple patch that adds a look up loop to do_enclose(),
if we find a mime type match based on the file extension it uses that
instead of the type provided by the hosting server.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11668>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list