Skip to content

Commit

Permalink
Allow a plugin to vary the comment cookie lifetime (or even remove th…
Browse files Browse the repository at this point in the history
…e cookies altogether). Fixes #4996.

git-svn-id: http://svn.automattic.com/wordpress/trunk@11223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
westi committed May 6, 2009
1 parent abe4bd3 commit cf2499b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions wp-comments-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@

$comment = get_comment($comment_id);
if ( !$user->ID ) {
setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
$comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000);
setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
setcookie('comment_author_url_' . COOKIEHASH, clean_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
}

$location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id;
Expand Down

0 comments on commit cf2499b

Please sign in to comment.