From 26c5a4f49da2d21c876e7d0fa458877c1d937d8d Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 6 Feb 2008 23:17:13 +0000 Subject: [PATCH] Make sure the theme_dir is a dir before we attempt to closedir(). fixes #5768 git-svn-id: https://develop.svn.wordpress.org/trunk@6744 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 6cef26f8b6..e6a6f28597 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -175,7 +175,8 @@ function get_themes() { } } } - @closedir($theme_dir); + if ( is_dir( $theme_dir ) ) + @closedir( $theme_dir ); if ( !$themes_dir || !$theme_files ) return $themes;