diff --git a/wp-comments-post.php b/wp-comments-post.php index 5c5faa568..3bebc15b6 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -50,7 +50,7 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-cache, must-revalidate, max-age=0'); header('Pragma: no-cache'); -$location = get_permalink($comment_post_ID); +$location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to']; header("Location: $location");