Update wp-comments-post.php to WP coding conventions. props JeremyVisser. fixes #4573
git-svn-id: http://svn.automattic.com/wordpress/trunk@5777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6e0ef646b7
commit
c671554b03
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
if ($_SERVER["REQUEST_METHOD"] != "POST") {
|
if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) {
|
||||||
header('Allow: POST');
|
header('Allow: POST');
|
||||||
header("HTTP/1.1 405 Method Not Allowed");
|
header('HTTP/1.1 405 Method Not Allowed');
|
||||||
header("Content-Type: text/plain");
|
header('Content-Type: text/plain');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
require( dirname(__FILE__) . '/wp-config.php' );
|
require( dirname(__FILE__) . '/wp-config.php' );
|
||||||
|
@ -63,11 +63,11 @@ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_emai
|
||||||
$comment_id = wp_new_comment( $commentdata );
|
$comment_id = wp_new_comment( $commentdata );
|
||||||
|
|
||||||
$comment = get_comment($comment_id);
|
$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_' . 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_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);
|
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 = ( empty($_POST['redirect_to']) ? get_permalink($comment_post_ID) : $_POST['redirect_to'] ) . '#comment-' . $comment_id;
|
||||||
$location = apply_filters('comment_post_redirect', $location, $comment);
|
$location = apply_filters('comment_post_redirect', $location, $comment);
|
||||||
|
|
Loading…
Reference in New Issue