Make WordPress Core

Ticket #10238: dont_lose_error_msgs.10238.diff

File dont_lose_error_msgs.10238.diff, 1.5 KB (added by filosofo, 17 years ago)
  • wp-admin/includes/media.php

     
    380380function media_upload_form_handler() {
    381381        check_admin_referer('media-form');
    382382
    383         $errors = array();
     383        $errors = null;
    384384
    385385        if ( isset($_POST['send']) ) {
    386386                $keys = array_keys($_POST['send']);
  • wp-admin/media-upload.php

     
    2929        wp_die(__("You are not allowed to be here"));
    3030
    3131if ( isset($_GET['inline']) ) {
     32        $errors = array();
    3233
    33         if ( isset($_GET['upload-page-form']) ) {
    34                 $errors = media_upload_form_handler();
    35 
    36                 $location = 'upload.php';
    37                 if ( $errors )
    38                         $location .= '?message=3';
    39 
    40                 wp_redirect( admin_url($location) );
    41         }
    42 
    4334        if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
    4435                // Upload File button was clicked
    4536                $id = media_handle_upload('async-upload', $_REQUEST['post_id']);
    … …  
    5041                }
    5142        }
    5243
     44        if ( isset($_GET['upload-page-form']) ) {
     45                $errors = array_merge($errors, (array) media_upload_form_handler());
     46
     47                $location = 'upload.php';
     48                if ( $errors )
     49                        $location .= '?message=3';
     50
     51                wp_redirect( admin_url($location) );
     52        }
     53
    5354        $title = __('Upload New Media');
    5455        $parent_file = 'upload.php';
    5556        require_once('admin-header.php'); ?>