Redirect to permalink instead of referrer. Fixes #1673
git-svn-id: http://svn.automattic.com/wordpress/trunk@2984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e445ffe7e6
commit
140f059191
|
@ -1,6 +1,8 @@
|
|||
<?php
|
||||
require( dirname(__FILE__) . '/wp-config.php' );
|
||||
|
||||
nocache_headers();
|
||||
|
||||
$comment_post_ID = (int) $_POST['comment_post_ID'];
|
||||
|
||||
$status = $wpdb->get_row("SELECT post_status, comment_status FROM $wpdb->posts WHERE ID = '$comment_post_ID'");
|
||||
|
@ -54,9 +56,8 @@ if ( !$user_ID ) :
|
|||
setcookie('comment_author_url_' . COOKIEHASH, stripslashes($comment_author_url), time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
|
||||
endif;
|
||||
|
||||
nocache_headers();
|
||||
|
||||
$location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to'];
|
||||
$location = ( empty( $_POST['redirect_to'] ) ) ? get_permalink( $comment_post_ID ) : $_POST['redirect_to'];
|
||||
|
||||
wp_redirect( $location );
|
||||
|
||||
?>
|
Loading…
Reference in New Issue