From 23755473ac86ef5a115e4f2a569ab808dd8e8b6d Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@20551 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index c01c9a07fd..34c028e816 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.