`media-new.php`, when using the browser uploader, if the result of uploading is a `WP_Error` - `wp_die()` with the error, instead of redirecting with a generic error.

Props solarissmoke.
Fixes #16820. 

Built from https://develop.svn.wordpress.org/trunk@34002


git-svn-id: http://core.svn.wordpress.org/trunk@33971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-10 17:18:24 +00:00
parent 47409875ab
commit 811f76699b
2 changed files with 6 additions and 6 deletions

View File

@ -25,15 +25,15 @@ if ( isset( $_REQUEST['post_id'] ) ) {
} }
if ( $_POST ) { if ( $_POST ) {
$location = 'upload.php';
if ( isset($_POST['html-upload']) && !empty($_FILES) ) { if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
check_admin_referer('media-form'); check_admin_referer('media-form');
// Upload File button was clicked // Upload File button was clicked
$id = media_handle_upload( 'async-upload', $post_id ); $upload_id = media_handle_upload( 'async-upload', $post_id );
if ( is_wp_error( $id ) ) if ( is_wp_error( $upload_id ) ) {
$location .= '?message=3'; wp_die( $upload_id );
}
} }
wp_redirect( admin_url( $location ) ); wp_redirect( admin_url( 'upload.php' ) );
exit; exit;
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-34001'; $wp_version = '4.4-alpha-34002';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.