[wp-trac] [WordPress Trac] #18730: media_sideload_image() doesn't handle dynamic image url's well
WordPress Trac
wp-trac at lists.automattic.com
Tue Oct 11 02:09:49 UTC 2011
#18730: media_sideload_image() doesn't handle dynamic image url's well
------------------------------+------------------------------
Reporter: dd32 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Warnings/Notices | Version:
Severity: normal | Resolution:
Keywords: |
------------------------------+------------------------------
Changes (by JustinSainton):
* cc: JustinSainton (added)
Comment:
Probably not relevant for your use case, but I was able to get around a
similar bug by modifying the wp_check_filetype_and_ext filter as such -
{{{
add_filter( 'wp_check_filetype_and_ext', 'gd_pdf_bypass' );
function gd_pdf_bypass( $filearray ) {
$filearray['type'] = 'image/jpeg';
$filearray['ext'] = 1;
return $filearray;
}
}}}
Granted, still doesn't attach properly (not necessary in my use case), but
I'm able to get it to return the proper <img> tag and upload to the server
with the override.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18730#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list