[wp-trac] [WordPress Trac] #24639: search_theme_directories returns nothing if scandir() returns FALSE
WordPress Trac
noreply at wordpress.org
Mon Jun 24 23:48:58 UTC 2013
#24639: search_theme_directories returns nothing if scandir() returns FALSE
--------------------------+-----------------------------
Reporter: csixty4 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: trunk
Severity: normal | Keywords: dev-feedback
--------------------------+-----------------------------
I'm experimenting with ways to detect themes & plugins WordPress can't
upgrade automatically, and found that wp_get_themes() (wp-
includes/theme.php) returns an empty array if one of the theme directories
is unreadable (chmod 770, neither owner or group exist).
Currently, the search_theme_directories() function returns false if any
scandir() calls return false. Shouldn't it return a list of valid themes
it ''can'' access, ignoring the ones it can't?
The attached patch issues a "continue" statement if scandir() returns
false, so at least some information is returned. It isn't enough to help
me detect those cases where a theme can't be updated, but it's probably
more useful for people who need a list of themes.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24639>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list