Skip to content

Commit

Permalink
Don't return false from search_theme_directories() when a single dire…
Browse files Browse the repository at this point in the history
…ctory is not readable.

Issue a notice.

props csixty4.
fixes #24639.



git-svn-id: http://core.svn.wordpress.org/trunk@24976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
nacin committed Aug 5, 2013
1 parent 82c4745 commit dfb236e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions wp-includes/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,10 @@ function search_theme_directories( $force = false ) {

// Start with directories in the root of the current theme directory.
$dirs = @ scandir( $theme_root );
if ( ! $dirs )
return false;
if ( ! $dirs ) {
trigger_error( "$theme_root is not readable", E_USER_NOTICE );
continue;
}
foreach ( $dirs as $dir ) {
if ( ! is_dir( $theme_root . '/' . $dir ) || $dir[0] == '.' || $dir == 'CVS' )
continue;
Expand All @@ -390,8 +392,10 @@ function search_theme_directories( $force = false ) {
// wp-content/themes/a-folder-of-themes/*
// wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs
$sub_dirs = @ scandir( $theme_root . '/' . $dir );
if ( ! $sub_dirs )
return false;
if ( ! $sub_dirs ) {
trigger_error( "$theme_root/$dir is not readable", E_USER_NOTICE );
continue;
}
foreach ( $sub_dirs as $sub_dir ) {
if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || $dir[0] == '.' || $dir == 'CVS' )
continue;
Expand Down

0 comments on commit dfb236e

Please sign in to comment.