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. Built from https://develop.svn.wordpress.org/trunk@53253 git-svn-id: http://core.svn.wordpress.org/trunk@52842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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