Make WordPress Core


Ignore:
Timestamp:
06/06/2020 09:51:22 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.3 branch.
See #49956.

Location:
branches/5.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

  • branches/5.3/src/wp-includes/comment.php

    r46427 r47916  
    18321832
    18331833        if ( $comment && hash_equals( $_GET['moderation-hash'], wp_hash( $comment->comment_date_gmt ) ) ) {
    1834             $commenter_email = $comment->comment_author_email;
     1834            // The comment will only be viewable by the comment author for 1 minute.
     1835            $comment_preview_expires = strtotime( $comment->comment_date_gmt . '+1 minute' );
     1836
     1837            if ( time() < $comment_preview_expires ) {
     1838                $commenter_email = $comment->comment_author_email;
     1839            }
    18351840        }
    18361841    }
Note: See TracChangeset for help on using the changeset viewer.