Make WordPress Core

Changeset 2984


Ignore:
Timestamp:
11/05/2005 10:08:56 PM (19 years ago)
Author:
matt
Message:

Redirect to permalink instead of referrer. Fixes #1673

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-comments-post.php

    r2837 r2984  
    11<?php
    22require( dirname(__FILE__) . '/wp-config.php' );
     3
     4nocache_headers();
    35
    46$comment_post_ID = (int) $_POST['comment_post_ID'];
     
    4749$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID');
    4850
    49 wp_new_comment($commentdata);
     51wp_new_comment( $commentdata );
    5052
    5153if ( !$user_ID ) :
     
    5557endif;
    5658
    57 nocache_headers();
     59$location = ( empty( $_POST['redirect_to'] ) ) ? get_permalink( $comment_post_ID ) : $_POST['redirect_to'];
    5860
    59 $location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to'];
     61wp_redirect( $location );
    6062
    61 wp_redirect($location);
    6263?>
Note: See TracChangeset for help on using the changeset viewer.