From 811f76699bed1f593ad97c385090d88d7b13192f Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 10 Sep 2015 17:18:24 +0000 Subject: [PATCH] `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 --- wp-admin/media-new.php | 10 +++++----- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-admin/media-new.php b/wp-admin/media-new.php index c8263d8ac9..9d26651e85 100644 --- a/wp-admin/media-new.php +++ b/wp-admin/media-new.php @@ -25,15 +25,15 @@ if ( isset( $_REQUEST['post_id'] ) ) { } if ( $_POST ) { - $location = 'upload.php'; if ( isset($_POST['html-upload']) && !empty($_FILES) ) { check_admin_referer('media-form'); // Upload File button was clicked - $id = media_handle_upload( 'async-upload', $post_id ); - if ( is_wp_error( $id ) ) - $location .= '?message=3'; + $upload_id = media_handle_upload( 'async-upload', $post_id ); + if ( is_wp_error( $upload_id ) ) { + wp_die( $upload_id ); + } } - wp_redirect( admin_url( $location ) ); + wp_redirect( admin_url( 'upload.php' ) ); exit; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 580e653a01..cc3ad17e39 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @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.