From 7d3b9ccb225dfb8c9cc32f995defac96001af0e5 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 25 Mar 2014 13:07:14 +0000 Subject: [PATCH] Encode spaces in get_template_directory_uri() and get_stylesheet_directory_uri(). props SergeyBiryukov. fixes #21969. Built from https://develop.svn.wordpress.org/trunk@27710 git-svn-id: http://core.svn.wordpress.org/trunk@27549 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index d643a9e289..8a675d44a9 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -187,7 +187,7 @@ function get_stylesheet_directory() { * @return string */ function get_stylesheet_directory_uri() { - $stylesheet = get_stylesheet(); + $stylesheet = str_replace( '%2F', '/', rawurlencode( get_stylesheet() ) ); $theme_root_uri = get_theme_root_uri( $stylesheet ); $stylesheet_dir_uri = "$theme_root_uri/$stylesheet"; @@ -318,7 +318,7 @@ function get_template_directory() { * @return string Template directory URI. */ function get_template_directory_uri() { - $template = get_template(); + $template = str_replace( '%2F', '/', rawurlencode( get_template() ) ); $theme_root_uri = get_theme_root_uri( $template ); $template_dir_uri = "$theme_root_uri/$template";