Skip to content

Commit

Permalink
Update wp-comments-post.php to WP coding conventions. props JeremyVis…
Browse files Browse the repository at this point in the history
…ser. fixes #4573

git-svn-id: http://svn.automattic.com/wordpress/trunk@5777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
markjaquith committed Jul 4, 2007
1 parent 6e0ef64 commit c671554
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wp-comments-post.php
@@ -1,9 +1,9 @@
<?php
if ($_SERVER["REQUEST_METHOD"] != "POST") {
header('Allow: POST');
header("HTTP/1.1 405 Method Not Allowed");
header("Content-Type: text/plain");
exit;
if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {
header('Allow: POST');
header('HTTP/1.1 405 Method Not Allowed');
header('Content-Type: text/plain');
exit;
}
require( dirname(__FILE__) . '/wp-config.php' );

Expand Down Expand Up @@ -63,11 +63,11 @@
$comment_id = wp_new_comment( $commentdata );

$comment = get_comment($comment_id);
if ( !$user->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);
endif;
}

$location = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comment-' . $comment_id;
$location = apply_filters('comment_post_redirect', $location, $comment);
Expand Down

0 comments on commit c671554

Please sign in to comment.