Changeset 22752 for trunk/wp-admin/media-new.php
- Timestamp:
- 11/21/2012 12:27:12 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/media-new.php
r22751 r22752 22 22 wp_enqueue_script( 'media-gallery' ); 23 23 24 $errors = array(); 24 25 25 // IDs should be integers 26 $ID = isset($ID) ? (int) $ID : 0; 27 $post_id = isset($post_id)? (int) $post_id : 0; 26 unset( $_REQUEST['post_id'] ); 28 27 29 // Require an ID for the edit screen 30 if ( isset($action) && $action == 'edit' && !$ID ) 31 wp_die( __( 'Cheatin’ uh?' ) ); 32 33 $errors = array(); 34 35 if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) ) 36 wp_die( __( 'Cheatin’ uh?' ) ); 37 28 if ( $_POST ) { 38 29 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 39 30 check_admin_referer('media-form'); … … 47 38 } 48 39 49 if ( isset($_GET['upload-page-form']) ) { 50 $errors = array_merge($errors, (array) media_upload_form_handler()); 40 $errors = array_merge($errors, (array) media_upload_form_handler()); 51 41 52 53 54 42 $location = 'upload.php'; 43 if ( $errors ) 44 $location .= '?message=3'; 55 45 56 wp_redirect( admin_url($location) ); 57 exit; 58 } 59 60 if ( isset( $_REQUEST['post_id'] ) ) 61 wp_die( __( 'Cheatin’ uh?' ) ); 46 wp_redirect( admin_url($location) ); 47 exit; 48 } 62 49 63 50 $title = __('Upload New Media'); … … 92 79 <h2><?php echo esc_html( $title ); ?></h2> 93 80 94 <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php ?inline=&upload-page-form='); ?>" class="<?php echo $form_class; ?>" id="file-form">81 <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php'); ?>" class="<?php echo $form_class; ?>" id="file-form"> 95 82 96 83 <?php media_upload_form(); ?>
Note: See TracChangeset
for help on using the changeset viewer.