Don't return false from search_theme_directories() when a single directory 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
This commit is contained in:
Andrew Nacin 2013-08-05 21:40:28 +00:00
parent 82c4745df2
commit dfb236ee00
1 changed files with 8 additions and 4 deletions

View File

@ -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;
@ -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;