Don't redirect continually on empty search results pages. Fixes #16357 props garyc40

git-svn-id: http://svn.automattic.com/wordpress/trunk@17366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2011-01-26 09:56:17 +00:00
parent 3d90dfb160
commit 9400a59207
3 changed files with 3 additions and 3 deletions

View File

@ -162,7 +162,7 @@ if ( ! empty($_REQUEST['_wp_http_referer']) ) {
$wp_list_table->prepare_items(); $wp_list_table->prepare_items();
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
if ( $pagenum > $total_pages ) { if ( $pagenum > $total_pages && $total_pages > 0 ) {
wp_redirect( add_query_arg( 'paged', $total_pages ) ); wp_redirect( add_query_arg( 'paged', $total_pages ) );
exit; exit;
} }

View File

@ -21,7 +21,7 @@ $pagenum = $wp_list_table->get_pagenum();
$wp_list_table->prepare_items(); $wp_list_table->prepare_items();
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
if ( $pagenum > $total_pages ) { if ( $pagenum > $total_pages && $total_pages > 0 ) {
wp_redirect( add_query_arg( 'paged', $total_pages ) ); wp_redirect( add_query_arg( 'paged', $total_pages ) );
exit; exit;
} }

View File

@ -291,7 +291,7 @@ default:
$wp_list_table->prepare_items(); $wp_list_table->prepare_items();
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
if ( $pagenum > $total_pages ) { if ( $pagenum > $total_pages && $total_pages > 0 ) {
wp_redirect( add_query_arg( 'paged', $total_pages ) ); wp_redirect( add_query_arg( 'paged', $total_pages ) );
exit; exit;
} }