Changeset 5867 for trunk/wp-includes/theme.php
- Timestamp:
- 08/14/2007 02:58:33 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/theme.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r5700 r5867 119 119 120 120 // Files in wp-content/themes directory and one subdir down 121 $themes_dir = @ dir($theme_root);121 $themes_dir = @ opendir($theme_root); 122 122 if ( !$themes_dir ) 123 123 return false; 124 124 125 while ( ($theme_dir = $themes_dir->read()) !== false ) {125 while ( ($theme_dir = readdir($themes_dir)) !== false ) { 126 126 if ( is_dir($theme_root . '/' . $theme_dir) && is_readable($theme_root . '/' . $theme_dir) ) { 127 127 if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) 128 128 continue; 129 $stylish_dir = @ dir($theme_root . '/' . $theme_dir);129 $stylish_dir = @ opendir($theme_root . '/' . $theme_dir); 130 130 $found_stylesheet = false; 131 while ( ($theme_file = $stylish_dir->read()) !== false ) {131 while ( ($theme_file = readdir($stylish_dir)) !== false ) { 132 132 if ( $theme_file == 'style.css' ) { 133 133 $theme_files[] = $theme_dir . '/' . $theme_file; … … 136 136 } 137 137 } 138 @closedir($stylish_dir); 138 139 if ( !$found_stylesheet ) { // look for themes in that dir 139 140 $subdir = "$theme_root/$theme_dir"; 140 141 $subdir_name = $theme_dir; 141 $theme_subdir = @ dir( $subdir );142 while ( ($theme_dir = $theme_subdir->read()) !== false ) {142 $theme_subdir = @ opendir( $subdir ); 143 while ( ($theme_dir = readdir($theme_subdir)) !== false ) { 143 144 if ( is_dir( $subdir . '/' . $theme_dir) && is_readable($subdir . '/' . $theme_dir) ) { 144 145 if ( $theme_dir{0} == '.' || $theme_dir == '..' || $theme_dir == 'CVS' ) 145 146 continue; 146 $stylish_dir = @ dir($subdir . '/' . $theme_dir);147 $stylish_dir = @ opendir($subdir . '/' . $theme_dir); 147 148 $found_stylesheet = false; 148 while ( ($theme_file = $stylish_dir->read()) !== false ) {149 while ( ($theme_file = readdir($stylish_dir)) !== false ) { 149 150 if ( $theme_file == 'style.css' ) { 150 151 $theme_files[] = $subdir_name . '/' . $theme_dir . '/' . $theme_file; … … 153 154 } 154 155 } 156 @closedir($stylish_dir); 155 157 } 156 158 } 159 @closedir($theme_subdir); 157 160 $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.')); 158 161 } 159 162 } 160 163 } 164 @closedir($theme_dir); 161 165 162 166 if ( !$themes_dir || !$theme_files )
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)