WordPress.org

Make WordPress Core

Ticket #15508: 15508.diff

File 15508.diff, 4.0 KB (added by garyc40, 3 years ago)

there's a patch for that

  • wp-comments-post.php

    diff --git wp-comments-post.php wp-comments-post.php
    index 9c17a35..4516258 100644
    if ( $user->ID ) { 
    7373 
    7474$comment_type = ''; 
    7575 
    76 if ( get_option('require_name_email') && !$user->ID ) { 
     76if ( get_option('require_name_email') && ! is_user_logged_in() ) { 
    7777        if ( 6 > strlen($comment_author_email) || '' == $comment_author ) 
    7878                wp_die( __('Error: please fill the required fields (name, email).') ); 
    7979        elseif ( !is_email($comment_author_email)) 
    $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_emai 
    9090$comment_id = wp_new_comment( $commentdata ); 
    9191 
    9292$comment = get_comment($comment_id); 
    93 if ( !$user->ID ) { 
     93if ( ! is_user_logged_in() ) { 
    9494        $comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000); 
    9595        setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN); 
    9696        setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN); 
  • wp-includes/comment-template.php

    diff --git wp-includes/comment-template.php wp-includes/comment-template.php
    index d00c659..31e2ce7 100644
    function comments_popup_link( $zero = false, $one = false, $more = false, $css_c 
    10341034 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed. 
    10351035 */ 
    10361036function get_comment_reply_link($args = array(), $comment = null, $post = null) { 
    1037         global $user_ID; 
    1038  
    10391037        $defaults = array('add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __('Reply'), 
    10401038                'login_text' => __('Log in to Reply'), 'depth' => 0, 'before' => '', 'after' => ''); 
    10411039 
    function get_comment_reply_link($args = array(), $comment = null, $post = null) 
    10561054 
    10571055        $link = ''; 
    10581056 
    1059         if ( get_option('comment_registration') && !$user_ID ) 
     1057        if ( get_option('comment_registration') && ! is_user_logged_in() ) 
    10601058                $link = '<a rel="nofollow" class="comment-reply-login" href="' . esc_url( wp_login_url( get_permalink() ) ) . '">' . $login_text . '</a>'; 
    10611059        else 
    10621060                $link = "<a class='comment-reply-link' href='" . esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $respond_id . "' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; 
    function comment_reply_link($args = array(), $comment = null, $post = null) { 
    10951093 * @return string|bool|null Link to show comment form, if successful. False, if comments are closed. 
    10961094 */ 
    10971095function get_post_reply_link($args = array(), $post = null) { 
    1098         global $user_ID; 
    1099  
    11001096        $defaults = array('add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __('Leave a Comment'), 
    11011097                'login_text' => __('Log in to leave a Comment'), 'before' => '', 'after' => ''); 
    11021098 
    function get_post_reply_link($args = array(), $post = null) { 
    11071103        if ( !comments_open($post->ID) ) 
    11081104                return false; 
    11091105 
    1110         if ( get_option('comment_registration') && !$user_ID ) { 
     1106        if ( get_option('comment_registration') && ! is_user_logged_in() ) { 
    11111107                $link = '<a rel="nofollow" href="' . wp_login_url( get_permalink() ) . '">' . $login_text . '</a>'; 
    11121108        } else { 
    11131109                $link = "<a rel='nofollow' class='comment-reply-link' href='" . get_permalink($post->ID) . "#$respond_id' onclick='return addComment.moveForm(\"$add_below-$post->ID\", \"0\", \"$respond_id\", \"$post->ID\")'>$reply_text</a>"; 
  • wp-includes/ms-deprecated.php

    diff --git wp-includes/ms-deprecated.php wp-includes/ms-deprecated.php
    index a7f7eb2..c307f04 100644
    function is_site_admin( $user_login = '' ) { 
    4444        _deprecated_function( __FUNCTION__, '3.0', 'is_super_admin()' ); 
    4545 
    4646        if ( empty( $user_login ) ) { 
    47                 $user_id = get_current_user_id(); 
    48                 if ( !$user_id ) 
     47                if ( ! is_user_logged_in() ) 
    4948                        return false; 
    5049        } else { 
    5150                $user = get_user_by( 'login', $user_login );