Ticket #13418: 13418.patch
File 13418.patch, 2.0 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/media.php
1844 1844 * 1845 1845 * @param unknown_type $errors 1846 1846 */ 1847 function media_upload_library_form( $errors) {1847 function media_upload_library_form( $errors ) { 1848 1848 global $wpdb, $wp_query, $wp_locale, $type, $tab, $post_mime_types; 1849 1849 1850 1850 media_upload_header(); 1851 1851 1852 $post_id = intval($_REQUEST['post_id']);1852 $post_id = (int) $_REQUEST['post_id']; 1853 1853 1854 $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id");1855 $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type);1854 $form_action_url = admin_url( "media-upload.php?type=$type&tab=library&post_id=$post_id" ); 1855 $form_action_url = apply_filters( 'media_upload_form_url', $form_action_url, $type ); 1856 1856 1857 $_GET['paged'] = isset( $_GET['paged'] ) ? intval($_GET['paged']) : 0; 1858 if ( $_GET['paged'] < 1 ) 1859 $_GET['paged'] = 1; 1860 $start = ( $_GET['paged'] - 1 ) * 10; 1861 if ( $start < 1 ) 1862 $start = 0; 1857 $_GET['paged'] = empty( $_GET['paged'] ) ? 0 : (int) $_GET['paged']; 1858 $_GET['paged'] = max( 1, $_GET['paged'] ); 1859 $start = ( $_GET['paged'] - 1 ) * 10; 1860 1863 1861 add_filter( 'post_limits', create_function( '$a', "return 'LIMIT $start, 10';" ) ); 1864 1862 1865 1863 list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query(); … … 1869 1867 <form id="filter" action="" method="get"> 1870 1868 <input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" /> 1871 1869 <input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" /> 1872 <input type="hidden" name="post_id" value="<?php echo (int)$post_id; ?>" />1870 <input type="hidden" name="post_id" value="<?php echo $post_id; ?>" /> 1873 1871 <input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? esc_attr( $_GET['post_mime_type'] ) : ''; ?>" /> 1874 1872 1875 1873 <p id="media-search" class="search-box">