Make WordPress Core

Changeset 12461


Ignore:
Timestamp:
12/19/2009 11:30:54 AM (15 years ago)
Author:
westi
Message:

Ensure that bulk comment actions do not remove spaces from search terms.
Also refactors comment bulk action redirect url building to be consistent with other operations.
Fixes #11471 props nacin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r12375 r12461  
    3333        $doaction = $_REQUEST['action'];
    3434    } else {
    35         wp_redirect($_SERVER['HTTP_REFERER']);
     35        wp_redirect( wp_get_referer() );
    3636    }
    3737
    3838    $approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
     39    $redirect_to = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids'), wp_get_referer() );
    3940
    4041    foreach ($comment_ids as $comment_id) { // Check the permissions on each
     
    7576        }
    7677    }
    77 
    78     $redirect_to = 'edit-comments.php';
    7978
    8079    if ( $approved )
     
    9594        $redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to );
    9695
    97     if ( $post_id )
    98         $redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
    99     if ( isset($_REQUEST['apage']) )
    100         $redirect_to = add_query_arg( 'apage', absint($_REQUEST['apage']), $redirect_to );
    101     if ( !empty($_REQUEST['mode']) )
    102         $redirect_to = add_query_arg('mode', $_REQUEST['mode'], $redirect_to);
    103     if ( !empty($_REQUEST['comment_status']) )
    104         $redirect_to = add_query_arg('comment_status', $_REQUEST['comment_status'], $redirect_to);
    105     if ( !empty($_REQUEST['s']) )
    106         $redirect_to = add_query_arg('s', $_REQUEST['s'], $redirect_to);
    10796    wp_redirect( $redirect_to );
     97    exit;
    10898} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
    10999     wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
Note: See TracChangeset for help on using the changeset viewer.