Ticket #17976: cookies.diff
File cookies.diff, 2.9 KB (added by , 12 years ago) |
---|
-
wp-comments-post.php
90 90 $comment_id = wp_new_comment( $commentdata ); 91 91 92 92 $comment = get_comment($comment_id); 93 if ( !$user->ID ) {94 $comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000);95 setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);96 setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);97 setcookie('comment_author_url_' . COOKIEHASH, esc_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);98 }99 93 100 94 $location = empty($_POST['redirect_to']) ? get_comment_link($comment_id) : $_POST['redirect_to'] . '#comment-' . $comment_id; 101 95 $location = apply_filters('comment_post_redirect', $location, $comment); -
wp-includes/default-filters.php
253 253 add_action( 'save_post', '_save_post_hook', 5, 2 ); 254 254 add_action( 'transition_post_status', '_transition_post_status', 5, 3 ); 255 255 add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); 256 add_action( 'comment_post', 'wp_set_comment_cookies'); 256 257 add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' ); 257 258 add_action( 'before_wp_tiny_mce', 'wp_print_editor_js' ); 258 259 add_action( 'after_wp_tiny_mce', 'wp_preload_dialogs', 10, 1 ); -
wp-includes/functions.php
4549 4549 @header( 'X-Frame-Options: SAMEORIGIN' ); 4550 4550 } 4551 4551 4552 /** 4553 * Sets the cookies used to store an unauthenticated commentator's identity. Typically used 4554 * to recall previous comments by this commentator that are still held in moderation. 4555 * 4556 * @param string $id Comment id 4557 * 4558 */ 4559 //function wp_set_comment_cookies($author,$email,$url) { 4560 function wp_set_comment_cookies($id) { 4561 $comment = get_comment($id,ARRAY_A); 4562 $author = $comment['author']; 4563 $email = $comment['author_email']; 4564 $url = $comment['author_url']; 4565 if(!$user->ID){ 4566 $comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000); 4567 setcookie('comment_author_' . COOKIEHASH, $author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN); 4568 setcookie('comment_author_email_' . COOKIEHASH, $email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN); 4569 setcookie('comment_author_url_' . COOKIEHASH, esc_url($url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN); 4570 } 4571 } 4572 4573 4552 4574 ?>