mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 20:15:08 +00:00
Don't lose upload error messages. Props filosofo. fixes #10238 for 2.8.1
git-svn-id: http://svn.automattic.com/wordpress/branches/2.8@11639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6ee80c9cce
commit
e27995486a
@ -380,7 +380,7 @@ add_action( 'media_buttons', 'media_buttons' );
|
||||
function media_upload_form_handler() {
|
||||
check_admin_referer('media-form');
|
||||
|
||||
$errors = array();
|
||||
$errors = null;
|
||||
|
||||
if ( isset($_POST['send']) ) {
|
||||
$keys = array_keys($_POST['send']);
|
||||
|
@ -29,16 +29,7 @@ if ( isset($action) && $action == 'edit' && !$ID )
|
||||
wp_die(__("You are not allowed to be here"));
|
||||
|
||||
if ( isset($_GET['inline']) ) {
|
||||
|
||||
if ( isset($_GET['upload-page-form']) ) {
|
||||
$errors = media_upload_form_handler();
|
||||
|
||||
$location = 'upload.php';
|
||||
if ( $errors )
|
||||
$location .= '?message=3';
|
||||
|
||||
wp_redirect( admin_url($location) );
|
||||
}
|
||||
$errors = array();
|
||||
|
||||
if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
|
||||
// Upload File button was clicked
|
||||
@ -50,6 +41,16 @@ if ( isset($_GET['inline']) ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_GET['upload-page-form']) ) {
|
||||
$errors = array_merge($errors, (array) media_upload_form_handler());
|
||||
|
||||
$location = 'upload.php';
|
||||
if ( $errors )
|
||||
$location .= '?message=3';
|
||||
|
||||
wp_redirect( admin_url($location) );
|
||||
}
|
||||
|
||||
$title = __('Upload New Media');
|
||||
$parent_file = 'upload.php';
|
||||
require_once('admin-header.php'); ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user