[wp-trac] [WordPress Trac] #38481: wp_handle_upload_prefilter not used before deriving attachment title

WordPress Trac noreply at wordpress.org
Tue Oct 25 08:30:20 UTC 2016


#38481: wp_handle_upload_prefilter not used before deriving attachment title
--------------------------+-----------------------------
 Reporter:  frodeborli    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Upload        |    Version:  4.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I created a module that modifies upload behavior. I use the
 wp_handle_upload_prefilter to alter the $_FILES data - specifically the
 'name' property of the uploaded file.

 This works well for changing the name of the file being stored in the file
 system, but the title of the attachment post still accesses the $_FILES
 ['async-upload']['name'] on line 281 of media.php.

 To be able to override the title, I had to hook into the 'sanitize_title'
 filter on line 293 of media.php - and doing that is, in my book, a hack.

 This sanitize_title filter should specify a context.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38481>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list