From fe63ec5dec454b8ac1e867bb2824bd96e1120e0c Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 20 Apr 2012 13:22:54 +0000 Subject: [PATCH] If a cached theme root is no longer registered, skip it. Assume the cache is out of date. see #20103. git-svn-id: http://svn.automattic.com/wordpress/trunk@20551 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index c01c9a07f..34c028e81 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -340,6 +340,9 @@ function search_theme_directories( $force = false ) { $cached_roots = get_site_transient( 'theme_roots' ); if ( is_array( $cached_roots ) ) { foreach ( $cached_roots as $theme_dir => $theme_root ) { + // A cached theme root is no longer around, so skip it. + if ( ! isset( $relative_theme_roots[ $theme_root ] ) ) + continue; $found_themes[ $theme_dir ] = array( 'theme_file' => $theme_dir . '/style.css', 'theme_root' => $relative_theme_roots[ $theme_root ], // Convert relative to absolute.