Ticket #52406: 52406.diff
File 52406.diff, 2.1 KB (added by , 4 years ago) |
---|
-
src/wp-includes/class-wp.php
405 405 if ( is_user_logged_in() ) { 406 406 $headers = array_merge( $headers, wp_get_nocache_headers() ); 407 407 } elseif ( ! empty( $_GET['unapproved'] ) && ! empty( $_GET['moderation-hash'] ) ) { 408 // Unmoderated comments are only visible for one minute via the moderation hash. 409 $headers['Expires'] = gmdate( 'D, d M Y H:i:s', time() + MINUTE_IN_SECONDS ); 410 $headers['Cache-Control'] = 'max-age=60, must-revalidate'; 408 // Unmoderated comments are only visible for 10 minutes via the moderation hash. 409 $expires = 10 * MINUTE_IN_SECONDS; 410 411 $headers['Expires'] = gmdate( 'D, d M Y H:i:s', time() + $expires ); 412 $headers['Cache-Control'] = sprintf( 413 'max-age=%d, must-revalidate', 414 $expires 415 ); 411 416 } 412 417 if ( ! empty( $this->query_vars['error'] ) ) { 413 418 $status = (int) $this->query_vars['error']; -
src/wp-includes/comment.php
1922 1922 * Used to allow the commenter to see their pending comment. 1923 1923 * 1924 1924 * @since 5.1.0 1925 * @since 5.7.0 The window within which the author email for an unapproved comment 1926 * can be retrieved was extended to 10 minutes. 1925 1927 * 1926 1928 * @return string The unapproved comment author's email (when supplied). 1927 1929 */ … … 1933 1935 $comment = get_comment( $comment_id ); 1934 1936 1935 1937 if ( $comment && hash_equals( $_GET['moderation-hash'], wp_hash( $comment->comment_date_gmt ) ) ) { 1936 // The comment will only be viewable by the comment author for 1 minute.1937 $comment_preview_expires = strtotime( $comment->comment_date_gmt . '+1 minute' );1938 // The comment will only be viewable by the comment author for 10 minutes. 1939 $comment_preview_expires = strtotime( $comment->comment_date_gmt . '+10 minutes' ); 1938 1940 1939 1941 if ( time() < $comment_preview_expires ) { 1940 1942 $commenter_email = $comment->comment_author_email;