WordPress.org

Make WordPress Core

Ticket #22572: 22572.patch

File 22572.patch, 1.5 KB (added by ocean90, 3 years ago)
  • wp-admin/includes/media.php

     
    21662166 * @since 2.6.0 
    21672167 */ 
    21682168function media_upload_flash_bypass() { 
     2169        $post = get_post(); 
    21692170        ?> 
    21702171        <p class="upload-flash-bypass"> 
    2171         <?php printf( __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" target="%2$s">browser uploader</a> instead.' ), admin_url( 'media-new.php?browser-uploader' ), '_blank' ); ?> 
     2172        <?php printf( __( 'You are using the multi-file uploader. Problems? Try the <a href="%1$s" target="%2$s">browser uploader</a> instead.' ), admin_url( 'media-new.php?browser-uploader&post_id=' . $post->ID ), '_blank' ); ?> 
    21722173        </p> 
    21732174        <?php 
    21742175} 
  • wp-admin/media-new.php

     
    1717 
    1818wp_enqueue_script('plupload-handlers'); 
    1919 
    20 unset( $_REQUEST['post_id'] ); 
    21  
    2220if ( $_POST ) { 
     21        $post_id = ! empty( $_REQUEST['post_id'] ) ? (int) $_REQUEST['post_id'] : 0; 
    2322        $location = 'upload.php'; 
    2423        if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 
    2524                check_admin_referer('media-form'); 
    2625                // Upload File button was clicked 
    27                 $id = media_handle_upload('async-upload', $_REQUEST['post_id']); 
     26                $id = media_handle_upload('async-upload', $post_id); 
    2827                if ( is_wp_error( $id ) ) 
    2928                        $location .= '?message=3'; 
    3029        }