Move closedir() to better locations to prevent the need for error suppression, prevents suppressed Warnings/Notices to be thrown during Plugin Installation. Fixes #16547

git-svn-id: http://svn.automattic.com/wordpress/trunk@17617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2011-04-07 09:07:56 +00:00
parent c1e70ae5e6
commit efa709d1b5
1 changed files with 2 additions and 5 deletions

View File

@ -243,19 +243,16 @@ function get_plugins($plugin_folder = '') {
if ( substr($subfile, -4) == '.php' )
$plugin_files[] = "$file/$subfile";
}
closedir( $plugins_subdir );
}
} else {
if ( substr($file, -4) == '.php' )
$plugin_files[] = $file;
}
}
} else {
return $wp_plugins;
closedir( $plugins_dir );
}
@closedir( $plugins_dir );
@closedir( $plugins_subdir );
if ( empty($plugin_files) )
return $wp_plugins;