wp_handle_upload unique_filename_callback problem
|Reported by:||xiosen||Owned by:||nacin|
Right now I am using wp_handle_upload to upload a file and I would like to provide a custom filename using the unique_filename_callback parameter.
If you look at 3.0.1 wp-includes/functions.php line 2218 inside the wp_unique_filename function. You will see that $dir, $name are passed into the callback function. However, the $name parameter is the filename without the extension, so the only thing missing is $ext. A callback function is unable to generate a proper filename without the original ext the file is in.
Line 2218 needs to look like:
$filename = $unique_filename_callback( $dir, $name, $ext );
Change History (6)
- Milestone changed from Awaiting Review to 3.1
- Owner set to nacin
- Status changed from new to accepted