From 37fae23001805bb345b8cab40155254502103dd0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 1 Mar 2013 17:20:32 +0000 Subject: [PATCH] Always wp_unslash() the return of wp_get_referer(). see #21767 git-svn-id: https://develop.svn.wordpress.org/trunk@23570 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/edit-form-advanced.php | 2 +- wp-admin/upgrade.php | 2 +- wp-admin/user-edit.php | 2 +- wp-includes/functions.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 2f5509e766..1c8b1b7ad3 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -314,7 +314,7 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create - + diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index 01552bd38b..9b15c81411 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -54,7 +54,7 @@ get_current_screen()->set_help_sidebar( '

' . __('Support Forums') . '

' ); -$wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer)); +$wp_http_referer = remove_query_arg(array('update', 'delete_count'), $wp_http_referer ); $user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index aa4a317130..79bba12117 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1283,7 +1283,7 @@ function wp_get_referer() { $ref = $_SERVER['HTTP_REFERER']; if ( $ref && $ref !== $_SERVER['REQUEST_URI'] ) - return $ref; + return wp_unslash( $ref ); return false; }