Comment Page URL fixes by wnorris. fixes #8297
git-svn-id: http://svn.automattic.com/wordpress/trunk@9831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a7258521b1
commit
c1f75d51ab
|
@ -165,10 +165,11 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
|
|||
$redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] );
|
||||
}
|
||||
|
||||
$paged_redirect['path'] = trailingslashit( preg_replace('|/index.php/?$|', '/', $paged_redirect['path']) ); // strip off trailing /index.php/
|
||||
$paged_redirect['path'] = user_trailingslashit( preg_replace('|/index.php/?$|', '/', $paged_redirect['path']) ); // strip off trailing /index.php/
|
||||
if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($paged_redirect['path'], '/index.php/') === false )
|
||||
$paged_redirect['path'] .= 'index.php/';
|
||||
$paged_redirect['path'] .= $addl_path;
|
||||
$paged_redirect['path'] = trailingslashit($paged_redirect['path']) . 'index.php/';
|
||||
if ( !empty( $addl_path ) )
|
||||
$paged_redirect['path'] = trailingslashit($paged_redirect['path']) . $addl_path;
|
||||
$redirect_url = $paged_redirect['scheme'] . '://' . $paged_redirect['host'] . $paged_redirect['path'];
|
||||
$redirect['path'] = $paged_redirect['path'];
|
||||
}
|
||||
|
|
|
@ -1230,20 +1230,20 @@ function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) {
|
|||
|
||||
$base = trailingslashit( get_bloginfo( 'home' ) );
|
||||
|
||||
$result = $base . $request;
|
||||
$result = user_trailingslashit($base . $request);
|
||||
|
||||
if ( 'newest' == get_option('default_comments_page') ) {
|
||||
if ( $pagenum != $max_page ) {
|
||||
if ( $wp_rewrite->using_permalinks() )
|
||||
$result = user_trailingslashit( trailingslashit($base . $request) . 'comment-page-' . $pagenum, 'commentpaged');
|
||||
$result = user_trailingslashit( trailingslashit($result) . 'comment-page-' . $pagenum, 'commentpaged');
|
||||
else
|
||||
$result = add_query_arg( 'cpage', $pagenum, $base . $request );
|
||||
$result = add_query_arg( 'cpage', $pagenum, $result );
|
||||
}
|
||||
} elseif ( $pagenum > 1 ) {
|
||||
if ( $wp_rewrite->using_permalinks() )
|
||||
$result = user_trailingslashit( trailingslashit($base . $request) . 'comment-page-' . $pagenum, 'commentpaged');
|
||||
$result = user_trailingslashit( trailingslashit($result) . 'comment-page-' . $pagenum, 'commentpaged');
|
||||
else
|
||||
$result = add_query_arg( 'cpage', $pagenum, $base . $request );
|
||||
$result = add_query_arg( 'cpage', $pagenum, $result );
|
||||
}
|
||||
|
||||
$result .= '#comments';
|
||||
|
|
Loading…
Reference in New Issue