mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-08 14:44:37 +00:00
Themes: Ensure WP_Theme::get_files() doesn't return unexpected values.
This change filters out empty entries from `WP_Theme::get_files()` before returning the array of files. This avoid returning an entry with `false` value when the directory of the theme does not exist. Props dd32, opurockey, Rahmohn, audrasjb. Fixes #53599. git-svn-id: https://develop.svn.wordpress.org/trunk@53253 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1210,7 +1210,7 @@ final class WP_Theme implements ArrayAccess {
|
||||
$files += (array) self::scandir( $this->get_template_directory(), $type, $depth );
|
||||
}
|
||||
|
||||
return $files;
|
||||
return array_filter( $files );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user