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:
parent
c1e70ae5e6
commit
efa709d1b5
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue