Ticket #16187: 16187.002.diff
File 16187.002.diff, 1.3 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/class-wp-list-table.php
436 436 function get_pagenum() { 437 437 $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0; 438 438 439 if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) 440 $pagenum = $this->_pagination_args['total_pages']; 441 439 442 return max( 1, $pagenum ); 440 443 } 441 444 -
wp-admin/upload.php
13 13 wp_die( __( 'You do not have permission to upload files.' ) ); 14 14 15 15 $wp_list_table = get_list_table('WP_Media_List_Table'); 16 $pagenum = $wp_list_table->get_pagenum(); 16 17 17 18 // Handle bulk actions 18 19 $doaction = $wp_list_table->current_action(); … … 129 130 130 131 $wp_list_table->prepare_items(); 131 132 133 $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); 134 if ( $pagenum > $total_pages && $total_pages > 0 ) { 135 wp_redirect( add_query_arg( 'paged', $total_pages ) ); 136 exit; 137 } 138 132 139 $title = __('Media Library'); 133 140 $parent_file = 'upload.php'; 134 141