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: https://develop.svn.wordpress.org/trunk@17617 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2b6b333f6b
commit
e849d6437d
@ -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
Block a user