From 32e982251648ed73feb333f06804d8a8fe85ff56 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 14 Apr 2008 16:01:59 +0000 Subject: [PATCH] Use error handler instead of die when moving files to upload dir fails. Props simonwheatley. fixes #6450 for trunk git-svn-id: https://develop.svn.wordpress.org/trunk@7644 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/file.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 4f582e8266..575a6782a4 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -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 ));