From b70875373094a0ff65b1850af71f2c49bbaaf053 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 20 Jan 2006 21:09:19 +0000 Subject: [PATCH] Don't use glob. Props David House. fixes #2312 git-svn-id: http://svn.automattic.com/wordpress/trunk@3468 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index a533eb4437..2bd59fdd8d 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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);