Theme subdirs that contain themes are not broken if missing a stylesheet. see #10467

git-svn-id: https://develop.svn.wordpress.org/trunk@12119 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-10-27 17:32:12 +00:00
parent ef9260219a
commit a96b4a4e18
1 changed files with 4 additions and 1 deletions

View File

@ -565,6 +565,7 @@ function search_theme_directories() {
$subdir_name = $theme_dir;
$theme_subdirs = @opendir( $subdir );
$found_subdir_themes = false;
while ( ($theme_subdir = readdir($theme_subdirs)) !== false ) {
if ( is_dir( $subdir . '/' . $theme_subdir) && is_readable($subdir . '/' . $theme_subdir) ) {
if ( $theme_subdir{0} == '.' || $theme_subdir == 'CVS' )
@ -577,6 +578,7 @@ function search_theme_directories() {
if ( $theme_file == 'style.css' ) {
$theme_files["$theme_dir/$theme_subdir"] = array( 'theme_file' => $subdir_name . '/' . $theme_subdir . '/' . $theme_file, 'theme_root' => $theme_root );
$found_stylesheet = true;
$found_subdir_themes = true;
break;
}
}
@ -584,7 +586,8 @@ function search_theme_directories() {
}
}
@closedir($theme_subdir);
$wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.'));
if ( !$found_subdir_themes )
$wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.'));
}
}
}