Make WordPress Core


Ignore:
Timestamp:
06/02/2020 08:24:59 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.

This brings the changes from [47887] to the 5.4 branch.

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

File:
1 edited

Legend:

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

    r47397 r47888  
    18381838
    18391839        if ( $comment && hash_equals( $_GET['moderation-hash'], wp_hash( $comment->comment_date_gmt ) ) ) {
    1840             $commenter_email = $comment->comment_author_email;
     1840            // The comment will only be viewable by the comment author for 1 minute.
     1841            $comment_preview_expires = strtotime( $comment->comment_date_gmt . '+1 minute' );
     1842
     1843            if ( time() < $comment_preview_expires ) {
     1844                $commenter_email = $comment->comment_author_email;
     1845            }
    18411846        }
    18421847    }
Note: See TracChangeset for help on using the changeset viewer.