[wp-trac] [WordPress Trac] #20057: Media upload for multi-webserver setups introduces a nasty race condition that could corrupt uploaded files

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 19 04:19:54 UTC 2012


#20057: Media upload for multi-webserver setups introduces a nasty race condition
that could corrupt uploaded files
--------------------------+------------------------------
 Reporter:  archon810     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  3.3.1
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by dd32):

 > wp_unique_filename() doesn't seem to have a filter: #19121

 You're right, I thought you could specify `$unique_filename_callback` via
 a filter in `wp_handle_upload()` but seems you can't.

 As an alternative, you can filter `$file['name']` via  the
 [http://core.trac.wordpress.org/browser/trunk/wp-
 admin/includes/file.php#L230 `wp_handle_upload_prefilter` filter], I would
 probably just prefix the files with the server it was uploaded on, but you
 should be able to rename the file to whatever you please at that point.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20057#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list