Best practice, use wp_safe_redirect() when dealing with referrers. Props nacin.

git-svn-id: https://develop.svn.wordpress.org/trunk@19579 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2011-12-10 18:26:48 +00:00
parent 8f50557a1b
commit ae0d5be06c
7 changed files with 26 additions and 26 deletions

View File

@@ -30,7 +30,7 @@ if ( $doaction ) {
} elseif ( isset( $_REQUEST['ids'] ) ) {
$comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );
} elseif ( wp_get_referer() ) {
wp_redirect( wp_get_referer() );
wp_safe_redirect( wp_get_referer() );
exit;
}
@@ -92,7 +92,7 @@ if ( $doaction ) {
if ( $trashed || $spammed )
$redirect_to = add_query_arg( 'ids', join( ',', $comment_ids ), $redirect_to );
wp_redirect( $redirect_to );
wp_safe_redirect( $redirect_to );
exit;
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );