Customize: Make sure that preview and return URLs are URLs.

Merge of [37527] to the 4.2 branch.
Built from https://develop.svn.wordpress.org/branches/4.2@37772


git-svn-id: http://core.svn.wordpress.org/branches/4.2@37737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2016-06-21 14:19:48 +00:00
parent 0ba49c4a4c
commit 569f0c90fc
1 changed files with 2 additions and 0 deletions

View File

@ -18,9 +18,11 @@ if ( ! current_user_can( 'customize' ) ) {
wp_reset_vars( array( 'url', 'return' ) );
$url = wp_unslash( $url );
$url = esc_url_raw( $url );
$url = wp_validate_redirect( $url, home_url( '/' ) );
if ( $return ) {
$return = wp_unslash( $return );
$return = esc_url_raw( $return );
$return = wp_validate_redirect( $return );
}
if ( ! $return ) {