diff --git a/wp-includes/theme.php b/wp-includes/theme.php index c4dc6435aa..3362c1d4ba 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -114,8 +114,9 @@ function get_themes() { $themes = array(); $wp_broken_themes = array(); - $theme_root = get_theme_root(); - $theme_loc = str_replace(ABSPATH, '', $theme_root); + $theme_loc = $theme_root = get_theme_root(); + if ( '/' != ABSPATH ) // don't want to replace all forward slashes, see Trac #4541 + $theme_loc = str_replace(ABSPATH, '', $theme_root); // Files in wp-content/themes directory and one subdir down $themes_dir = @ opendir($theme_root);