Make WordPress Core


Ignore:
Timestamp:
06/06/2020 10:07:01 AM (5 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-includes/comment.php

    r44843 r47918  
    17861786
    17871787        if ( $comment && hash_equals( $_GET['moderation-hash'], wp_hash( $comment->comment_date_gmt ) ) ) {
    1788             $commenter_email = $comment->comment_author_email;
     1788            // The comment will only be viewable by the comment author for 1 minute.
     1789            $comment_preview_expires = strtotime( $comment->comment_date_gmt . '+1 minute' );
     1790
     1791            if ( time() < $comment_preview_expires ) {
     1792                $commenter_email = $comment->comment_author_email;
     1793            }
    17891794        }
    17901795    }
Note: See TracChangeset for help on using the changeset viewer.