Skip to content
Browse files

Update wp-comments-post.php to WP coding conventions. props JeremyVis…

…ser. fixes #4573

git-svn-id: http://svn.automattic.com/wordpress/trunk@5777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 6e0ef64 commit c671554b03a9d6989394f5a6fb66816604a84ba1 markjaquith committed
Showing with 7 additions and 7 deletions.
  1. +7 −7 wp-comments-post.php
View
14 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' );
@@ -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);

0 comments on commit c671554

Please sign in to comment.
Something went wrong with that request. Please try again.