Index: wp-includes/canonical.php
===================================================================
--- wp-includes/canonical.php (revision 9351)
+++ wp-includes/canonical.php (working copy)
@@ -249,20 +249,20 @@
if ( $compare_original !== $compare_redirect ) {
$redirect_url = $redirect['scheme'] . '://' . $redirect['host'];
if ( !empty($redirect['port']) )
- $redirect_url .= ':' . $redirect['port'];
+ $redirect_url .= ':' . $redirect['port'];
$redirect_url .= $redirect['path'];
if ( !empty($redirect['query']) )
$redirect_url .= '?' . $redirect['query'];
}
if ( !$redirect_url || $redirect_url == $requested_url )
- return false;
+ return false;
// Note that you can use the "redirect_canonical" filter to cancel a canonical redirect for whatever reason by returning FALSE
$redirect_url = apply_filters('redirect_canonical', $redirect_url, $requested_url);
if ( !$redirect_url || $redirect_url == $requested_url ) // yes, again -- in case the filter aborted the request
- return false;
+ return false;
if ( $do_redirect ) {
// protect against chained redirects
Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php (revision 9351)
+++ wp-includes/comment-template.php (working copy)
@@ -402,7 +402,7 @@
}
/**
- * Retrieve the link to the current comment.
+ * Retrieve the link to a given comment.
*
* @since 1.5.0
* @uses $comment
@@ -411,8 +411,20 @@
* @return string The permalink to the current comment
*/
function get_comment_link($comment = null) {
+ global $wp_rewrite;
+
$comment = get_comment($comment);
- return get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID;
+
+ if ( get_option('page_comments') ) {
+ $page = get_page_of_comment( $comment->comment_ID );
+
+ if ( $wp_rewrite->using_permalinks() )
+ return user_trailingslashit( trailingslashit( get_permalink( $comment->comment_post_ID ) ) . "comment-page-$page", 'comment' ) . '#comment-' . $comment->comment_ID;
+ else
+ return add_query_arg( 'cpage', $page, get_permalink( $comment->comment_post_ID ) ) . '#comment-' . $comment->comment_ID;
+ } else {
+ return get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID;
+ }
}
/**
@@ -1085,7 +1097,7 @@
-