From e03640b121e1c9448c85e52b6732a543ecbccef2 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 3 Sep 2012 23:57:43 +0000 Subject: [PATCH] URL encode the stylesheet directory values passed to WP_Theme's get_stylesheet_directory_uri() and get_template_directory_uri(). props SergeyBiryukov, see #21749. git-svn-id: http://core.svn.wordpress.org/trunk@21712 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 8be643327b..13ccfc29e8 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -794,7 +794,7 @@ final class WP_Theme implements ArrayAccess { * @return string URL to the stylesheet directory. */ public function get_stylesheet_directory_uri() { - return $this->get_theme_root_uri() . '/' . $this->stylesheet; + return $this->get_theme_root_uri() . '/' . str_replace( '%2F', '/', rawurlencode( $this->stylesheet ) ); } /** @@ -814,7 +814,7 @@ final class WP_Theme implements ArrayAccess { else $theme_root_uri = $this->get_theme_root_uri(); - return $theme_root_uri . '/' . $this->template; + return $theme_root_uri . '/' . str_replace( '%2F', '/', rawurlencode( $this->template ) ); } /**