Make WordPress Core

Ticket #8055: 8055.patch

File 8055.patch, 968 bytes (added by Viper007Bond, 17 years ago)
  • wp-comments-post.php

     
    7979        setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
    8080}
    8181
    82 if ( empty($_POST['redirect_to']) )
    83         $postlink = ( 'newest' == get_option('default_comments_page') ) ? get_permalink($comment_post_ID) : add_query_arg( 'cpage', get_comment_pages_count( get_comments( array( 'post_id' => $comment_post_ID ) ) ), get_permalink($comment_post_ID) );
    84 
    85 $location = ( empty($_POST['redirect_to']) ? $postlink : $_POST['redirect_to'] ) . '#comment-' . $comment_id;
     82$location = ( empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] ) . '#comment-' . $comment_id;
    8683$location = apply_filters('comment_post_redirect', $location, $comment);
    8784
    8885wp_redirect($location);