Ticket #16820: 16820.diff
File 16820.diff, 1020 bytes (added by , 14 years ago) |
---|
-
wp-admin/media-upload.php
35 35 wp_die(__("You are not allowed to be here")); 36 36 37 37 if ( isset($_GET['inline']) ) { 38 $errors = array();39 40 38 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 41 39 // Upload File button was clicked 42 40 $id = media_handle_upload('async-upload', $_REQUEST['post_id']); 43 41 unset($_FILES); 44 if ( is_wp_error($id) ) { 45 $errors['upload_error'] = $id; 46 $id = false; 47 } 42 if ( is_wp_error($id) ) 43 wp_die( $id ); 48 44 } 49 45 50 46 if ( isset($_GET['upload-page-form']) ) { 51 $errors = array_merge($errors, (array) media_upload_form_handler()); 52 53 $location = 'upload.php'; 47 $errors = (array) media_upload_form_handler(); 54 48 if ( $errors ) 55 $location .= '?message=3'; 56 57 wp_redirect( admin_url($location) ); 58 exit; 49 wp_die( implode(' ', $errors) ); 59 50 } 60 51 61 52 $title = __('Upload New Media');