From dfb236ee00486de616473b5634ee4d1f09435b83 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 5 Aug 2013 21:40:28 +0000 Subject: [PATCH] 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 --- wp-includes/theme.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index a1dec2634e..68863a382a 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -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;