Make WordPress Core


Ignore:
Timestamp:
06/06/2020 10:07:01 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Comments: Ensure that unmoderated comments won't be search indexed.

After a comment is submitted, only allow a brief window where the comment is live on the site.

Props jonkolbert, ayeshrajans, Asif2BD, peterwilsoncc, imath, audrasjb, jonoaldersonwp, whyisjake, SergeyBiryukov.
Merges [47887] and [47889] to the 5.1 branch.
Fixes #49956.

Location:
branches/5.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.1

  • branches/5.1/src/wp-comments-post.php

    r44659 r47918  
    5757$location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment ) : $_POST['redirect_to'] . '#comment-' . $comment->comment_ID;
    5858
    59 // Add specific query arguments to display the awaiting moderation message.
    60 if ( 'unapproved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_author_email ) ) {
     59// If user didn't consent to cookies, add specific query arguments to display the awaiting moderation message.
     60if ( ! $cookies_consent && 'unapproved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_author_email ) ) {
    6161    $location = add_query_arg(
    6262        array(
Note: See TracChangeset for help on using the changeset viewer.