Use error handler instead of die when moving files to upload dir fails. Props simonwheatley. fixes #6450 for trunk

git-svn-id: http://svn.automattic.com/wordpress/trunk@7644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-04-14 16:01:59 +00:00
parent 36c9588f08
commit 796ae7104e

View File

@ -172,8 +172,9 @@ function wp_handle_upload( &$file, $overrides = false ) {
// Move the file to the uploads dir
$new_file = $uploads['path'] . "/$filename";
if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) )
wp_die( printf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ));
if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) {
return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
}
// Set correct file permissions
$stat = stat( dirname( $new_file ));