WordPress.org

Make WordPress Core

Ticket #13418: 13418.2.diff

File 13418.2.diff, 2.0 KB (added by MikeHansenMe, 8 years ago)

refresh based on original minus shorthand.

  • wp-admin/includes/media.php

     
    19241924 *
    19251925 * @param array $errors
    19261926 */
    1927 function media_upload_library_form($errors) {
     1927function media_upload_library_form( $errors ) {
    19281928        global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types;
    19291929
    19301930        media_upload_header();
    19311931
    1932         $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
     1932        if( isset( $_REQUEST['post_id'] ) ) {
     1933                $post_id = ( int ) $_REQUEST['post_id'];
     1934        } else {
     1935                $post_id = 0;
     1936        }
    19331937
    1934         $form_action_url = admin_url("media-upload.php?type=$type&tab=library&post_id=$post_id");
    1935         $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type);
     1938        $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id" );
     1939        $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type );
    19361940        $form_class = 'media-upload-form validate';
    19371941
    1938         if ( get_user_setting('uploader') )
     1942        if ( get_user_setting( 'uploader' ) )
    19391943                $form_class .= ' html-uploader';
    19401944
    1941         $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0;
     1945        if( isset( $_GET['paged'] ) ){
     1946                $_GET['paged'] = ( int ) $_GET['paged'];
     1947        } else {
     1948                $_GET['paged'] = 0;
     1949        }
     1950
    19421951        if ( $_GET['paged'] < 1 )
    19431952                $_GET['paged'] = 1;
    19441953        $start = ( $_GET['paged'] - 1 ) * 10;
     
    19531962<form id="filter" action="" method="get">
    19541963<input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" />
    19551964<input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" />
    1956 <input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
     1965<input type="hidden" name="post_id" value="<?php echo $post_id; ?>" />
    19571966<input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>" />
    19581967<input type="hidden" name="context" value="<?php echo isset( $_GET['context'] ) ? esc_attr( $_GET['context'] ) : ''; ?>" />
    19591968