diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index dd4d40cce..a46a9b11a 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -572,6 +572,13 @@ function validate_current_theme() {
return true;
}
+function get_broken_themes() {
+ global $wp_broken_themes;
+
+ get_themes();
+ return $wp_broken_themes;
+}
+
function get_page_templates() {
$themes = get_themes();
$theme = get_current_theme();
diff --git a/wp-admin/themes.php b/wp-admin/themes.php
index a486920cc..86ed602c8 100644
--- a/wp-admin/themes.php
+++ b/wp-admin/themes.php
@@ -99,6 +99,44 @@ $current_stylesheet = $themes[$current_theme]['Stylesheet'];
+
+
+
+
+
+
+
+
+ |
+ |
+
+
+ $title |
+ $description |
+ ";
+ }
+?>
+
+
+
read()) !== false) {
if (is_dir($theme_root . '/' . $theme_dir)) {
+ if ($theme_dir == '.' || $theme_dir == '..') {
+ continue;
+ }
$stylish_dir = @ dir($theme_root . '/' . $theme_dir);
+ $found_stylesheet = false;
while(($theme_file = $stylish_dir->read()) !== false) {
if ( $theme_file == 'style.css' ) {
$theme_files[] = $theme_dir . '/' . $theme_file;
+ $found_stylesheet = true;
+ break;
}
}
+ if (!$found_stylesheet) {
+ $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.'));
+ }
}
}
}
@@ -2062,6 +2073,11 @@ function get_themes() {
$template = $theme_data['Template'];
$stylesheet = dirname($theme_file);
+ if (empty($name)) {
+ $name = dirname($theme_file);
+ $title = $name;
+ }
+
if (empty($template)) {
if (file_exists(dirname("$theme_root/$theme_file/index.php"))) {
$template = dirname($theme_file);
@@ -2073,13 +2089,9 @@ function get_themes() {
$template = trim($template);
if (($template != 'default') && (! file_exists("$theme_root/$template/index.php"))) {
+ $wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.'));
continue;
}
-
- if (empty($name)) {
- $name = dirname($theme_file);
- $title = $name;
- }
$stylesheet_files = array();
if ($stylesheet != 'default') {