Don't use glob. Props David House. fixes #2312
git-svn-id: http://svn.automattic.com/wordpress/trunk@3468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3fa51b528a
commit
b708753730
|
@ -1791,11 +1791,12 @@ function get_themes() {
|
||||||
$template = $theme_data['Template'];
|
$template = $theme_data['Template'];
|
||||||
$stylesheet = dirname($theme_file);
|
$stylesheet = dirname($theme_file);
|
||||||
|
|
||||||
$screenshot = glob("$theme_root/$stylesheet/screenshot.*");
|
foreach (array('png', 'gif', 'jpg', 'jpeg') as $ext) {
|
||||||
if ( !empty( $screenshot ) )
|
if (file_exists("$theme_root/$stylesheet/screenshot.$ext")) {
|
||||||
$screenshot = basename( $screenshot[0] );
|
$screenshot = "screenshot.$ext";
|
||||||
else
|
break;
|
||||||
$screenshot = false;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( empty($name) ) {
|
if ( empty($name) ) {
|
||||||
$name = dirname($theme_file);
|
$name = dirname($theme_file);
|
||||||
|
|
Loading…
Reference in New Issue