Don't use glob. Props David House. fixes #2312

git-svn-id: https://develop.svn.wordpress.org/trunk@3468 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-01-20 21:09:19 +00:00
parent c2835f7266
commit 373ecf32fb
1 changed files with 6 additions and 5 deletions

View File

@ -1791,11 +1791,12 @@ function get_themes() {
$template = $theme_data['Template'];
$stylesheet = dirname($theme_file);
$screenshot = glob("$theme_root/$stylesheet/screenshot.*");
if ( !empty( $screenshot ) )
$screenshot = basename( $screenshot[0] );
else
$screenshot = false;
foreach (array('png', 'gif', 'jpg', 'jpeg') as $ext) {
if (file_exists("$theme_root/$stylesheet/screenshot.$ext")) {
$screenshot = "screenshot.$ext";
break;
}
}
if ( empty($name) ) {
$name = dirname($theme_file);