WordPress.org

Make WordPress Core

Changeset 11639


Ignore:
Timestamp:
06/25/09 06:09:41 (5 years ago)
Author:
ryan
Message:

Don't lose upload error messages. Props filosofo. fixes #10238 for 2.8.1

Location:
branches/2.8/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8/wp-admin/includes/media.php

    r11620 r11639  
    381381    check_admin_referer('media-form'); 
    382382 
    383     $errors = array(); 
     383    $errors = null; 
    384384 
    385385    if ( isset($_POST['send']) ) { 
  • branches/2.8/wp-admin/media-upload.php

    r11380 r11639  
    3030 
    3131if ( isset($_GET['inline']) ) { 
    32  
    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     } 
     32    $errors = array(); 
    4233 
    4334    if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 
     
    4940            $id = false; 
    5041        } 
     42    } 
     43 
     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) ); 
    5152    } 
    5253 
Note: See TracChangeset for help on using the changeset viewer.