WordPress.org

Make WordPress Core

Ticket #16187: 16187.diff

File 16187.diff, 1.2 KB (added by greuben, 4 years ago)
  • wp-admin/includes/class-wp-media-list-table.php

     
    2828                if ( !empty( $lost ) ) 
    2929                        $q['post__in'] = implode( ',', $lost ); 
    3030 
     31                if( $q['paged'] > $wp_query->max_num_pages ) 
     32                        $q['paged'] = $wp_query->max_num_pages; 
     33                 
    3134                list( $post_mime_types, $avail_post_mime_types ) = wp_edit_attachments_query( $q ); 
    3235 
    3336                $this->is_trash = isset( $_REQUEST['status'] ) && 'trash' == $_REQUEST['status']; 
  • wp-admin/includes/class-wp-list-table.php

     
    436436        function get_pagenum() { 
    437437                $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0; 
    438438 
     439                if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) 
     440                        $pagenum = $this->_pagination_args['total_pages']; 
     441                 
    439442                return max( 1, $pagenum ); 
    440443        } 
    441444