Changeset 2984

Show
Ignore:
Timestamp:
11/05/05 22:08:56 (3 years ago)
Author:
matt
Message:

Redirect to permalink instead of referrer. Fixes #1673

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 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?>