Ticket #11471: 11471.diff
File 11471.diff, 1.9 KB (added by , 15 years ago) |
---|
-
edit-comments.php
32 32 $comment_ids = array_map( 'absint', explode(',', $_REQUEST['ids']) ); 33 33 $doaction = $_REQUEST['action']; 34 34 } else { 35 wp_redirect( $_SERVER['HTTP_REFERER']);35 wp_redirect( wp_get_referer() ); 36 36 } 37 37 38 38 $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() ); 39 40 40 41 foreach ($comment_ids as $comment_id) { // Check the permissions on each 41 42 $_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) ); … … 75 76 } 76 77 } 77 78 78 $redirect_to = 'edit-comments.php';79 80 79 if ( $approved ) 81 80 $redirect_to = add_query_arg( 'approved', $approved, $redirect_to ); 82 81 if ( $unapproved ) … … 94 93 if ( $trashed || $spammed ) 95 94 $redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to ); 96 95 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);107 96 wp_redirect( $redirect_to ); 97 exit; 108 98 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { 109 99 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); 110 100 exit;