From efa709d1b568dc7ab8c95c31fe2e1d9ba596d7a8 Mon Sep 17 00:00:00 2001 From: dd32 Date: Thu, 7 Apr 2011 09:07:56 +0000 Subject: [PATCH] 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 --- wp-admin/includes/plugin.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index d10c450b3f..1597b2230d 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -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;