Make WordPress Core

Changeset 24976


Ignore:
Timestamp:
08/05/2013 09:40:28 PM (13 years ago)
Author:
nacin
Message:

Don't return false from search_theme_directories() when a single directory is not readable.

Issue a notice.

props csixty4.
fixes #24639.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r24386 r24976  
    374374                // Start with directories in the root of the current theme directory.
    375375                $dirs = @ scandir( $theme_root );
    376                 if ( ! $dirs )
    377                         return false;
     376                if ( ! $dirs ) {
     377                        trigger_error( "$theme_root is not readable", E_USER_NOTICE );
     378                        continue;
     379                }
    378380                foreach ( $dirs as $dir ) {
    379381                        if ( ! is_dir( $theme_root . '/' . $dir ) || $dir[0] == '.' || $dir == 'CVS' )
     
    391393                                // wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs
    392394                                $sub_dirs = @ scandir( $theme_root . '/' . $dir );
    393                                 if ( ! $sub_dirs )
    394                                         return false;
     395                                if ( ! $sub_dirs ) {
     396                                        trigger_error( "$theme_root/$dir is not readable", E_USER_NOTICE );
     397                                        continue;
     398                                }
    395399                                foreach ( $sub_dirs as $sub_dir ) {
    396400                                        if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || $dir[0] == '.' || $dir == 'CVS' )
Note: See TracChangeset for help on using the changeset viewer.