[wp-trac] [WordPress Trac] #16220: Media Upload from custom tab using Flash Uploader is broken

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 13 21:24:49 UTC 2011


#16220: Media Upload from custom tab using Flash Uploader is broken
--------------------------+---------------------------------------
 Reporter:  jackcrosby    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Upload        |    Version:  3.0.4
 Severity:  normal        |   Keywords:  upload, media, upload tab
--------------------------+---------------------------------------
 If you create a custom tab in the Media Uploader, and try to upload using
 the Flash Upload method (as opposed to the Browser Upload method), any
 hooks you have in place to intercept the upload ({{{media_upload_$tab}}})
 will not be triggered.

 Reason: The upload function are not aware of the tab. Even though the
 Flash Uploader passes the $tab variable, the upload functions are not
 receiving it.

 Cause: The $tab variable is set from the GET string ({{{$_GET['tab']}}}).
 This only works with the Browser Upload method. Flash passes variables
 with POST({{{$_POST['tab']}}}).

 Fix: Inside '''/wp-admin/media-upload.php''' and  '''/wp-
 admin/includes/media.php''' replace all {{{$_GET['tab']}}} with
 {{{$_REQUEST['tab']}}}.
 Also, the global $tab variable must be set.
 Add it to '''/wp-admin/includes/media.php''' around line {{{#101}}} after
 the 'else{'
 {{{global $tab;}}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16220>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list