Make WordPress Core

Ticket #24639: search_theme_directories_continue.patch

File search_theme_directories_continue.patch, 846 bytes (added by csixty4, 12 years ago)

continue instead of returning false when scandir() returns false

  • theme.php

     
    374374                // Start with directories in the root of the current theme directory.
    375375                $dirs = @ scandir( $theme_root );
    376376                if ( ! $dirs )
    377                         return false;
     377                        continue;
    378378                foreach ( $dirs as $dir ) {
    379379                        if ( ! is_dir( $theme_root . '/' . $dir ) || $dir[0] == '.' || $dir == 'CVS' )
    380380                                continue;
     
    391391                                // wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs
    392392                                $sub_dirs = @ scandir( $theme_root . '/' . $dir );
    393393                                if ( ! $sub_dirs )
    394                                         return false;
     394                                        continue;
    395395                                foreach ( $sub_dirs as $sub_dir ) {
    396396                                        if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || $dir[0] == '.' || $dir == 'CVS' )
    397397                                                continue;