URL encode the theme stylesheet passed into wp_customize_url(). see #21749.

git-svn-id: https://develop.svn.wordpress.org/trunk@21713 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-09-03 23:58:30 +00:00
parent 80f60bd348
commit be7d33f10d
1 changed files with 2 additions and 1 deletions

View File

@ -1646,11 +1646,12 @@ add_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings' );
* @since 3.4.0 * @since 3.4.0
* *
* @param string $stylesheet Optional. Theme to customize. Defaults to current theme. * @param string $stylesheet Optional. Theme to customize. Defaults to current theme.
* The theme's stylesheet will be urlencoded if necessary.
*/ */
function wp_customize_url( $stylesheet = null ) { function wp_customize_url( $stylesheet = null ) {
$url = admin_url( 'customize.php' ); $url = admin_url( 'customize.php' );
if ( $stylesheet ) if ( $stylesheet )
$url .= '?theme=' . $stylesheet; $url .= '?theme=' . urlencode( $stylesheet );
return esc_url( $url ); return esc_url( $url );
} }