]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/media-upload.php
Wizard 2.8.2-scripts
[autoinstalls/wordpress.git] / wp-admin / media-upload.php
index ccb364e00f0d6745044c4da30f3f313cfb2541ff..3766db8a611e0fec0783ef213f85ac5b59724bad 100644 (file)
@@ -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'); ?>