WordPress.org

Make WordPress Core

Ticket #18819: wp-comments-post.diff

File wp-comments-post.diff, 1.5 KB (added by WhiteJV, 7 years ago)

DIFF of wp-coments-posts.php

  • wp-comments-post.php

     
    9090$comment_id = wp_new_comment( $commentdata );
    9191
    9292$comment = get_comment($comment_id);
    93 if ( !$user->ID ) {
    94         $comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000);
    95         setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
    96         setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
    97         setcookie('comment_author_url_' . COOKIEHASH, esc_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
     93if ( (!defined('BLOCK_COMMENTER_COOKIES')) || (!BLOCK_COMMENTER_COOKIES) ) {
     94        if ( !$user->ID ) {
     95                $comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000);
     96                setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
     97                setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
     98                setcookie('comment_author_url_' . COOKIEHASH, esc_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
     99        }
    98100}
    99101
    100102$location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id;