Make WordPress Core


Ignore:
Timestamp:
06/02/2020 08:10:02 PM (4 years ago)
Author:
whyisjake
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.

Fixes #49956.
Props: jonkolbert, ayeshrajans, Asif2BD, peterwilsoncc, imath, audrasjb, jonoaldersonwp, whyisjake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r47808 r47887  
    18531853
    18541854        if ( $comment && hash_equals( $_GET['moderation-hash'], wp_hash( $comment->comment_date_gmt ) ) ) {
    1855             $commenter_email = $comment->comment_author_email;
     1855            // The comment will only be viewable by the comment author for 1 minute.
     1856            $comment_preview_expires = strtotime( $comment->comment_date_gmt . '+1 minute' );
     1857
     1858            if ( time() < $comment_preview_expires ) {
     1859                $commenter_email = $comment->comment_author_email;
     1860            }
    18561861        }
    18571862    }
Note: See TracChangeset for help on using the changeset viewer.