Make WordPress Core

Ticket #16612: 16612.3.diff

File 16612.3.diff, 1.3 KB (added by rachelbaker, 8 years ago)

Renames the function to wp_check_comment_cookies

  • src/wp-includes/class-wp.php

     
    401401                $status = null;
    402402                $exit_required = false;
    403403
    404                 if ( is_user_logged_in() )
     404                if ( is_user_logged_in() || wp_check_comment_cookies() )
    405405                        $headers = array_merge($headers, wp_get_nocache_headers());
    406406                if ( ! empty( $this->query_vars['error'] ) ) {
    407407                        $status = (int) $this->query_vars['error'];
  • src/wp-includes/comment.php

     
    523523}
    524524
    525525/**
     526 * Determine if any comment author identity cookies are present.
     527 *
     528 * @since 4.7.0
     529 *
     530 * @return boolean True if any comment cookies are found, otherwise false.
     531 */
     532function wp_check_comment_cookies() {
     533        if ( isset( $_COOKIE[ 'comment_author_' . COOKIEHASH ] ) || isset( $_COOKIE[ 'comment_author_email_' . COOKIEHASH ] ) || isset( $_COOKIE[ 'comment_author_url_' . COOKIEHASH ] ) ) {
     534                return true;
     535        }
     536
     537        return false;
     538}
     539
     540/**
    526541 * Sanitizes the cookies sent to the user already.
    527542 *
    528543 * Will only do anything if the cookies have already been created for the user.