Fix deletion of plugins not in their own directory. Props DD32. see #5586
git-svn-id: https://develop.svn.wordpress.org/trunk@7209 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a7e4b47750
commit
15512e1ed8
@ -184,7 +184,7 @@ function wp_update_plugin($plugin, $feedback = '') {
|
||||
$plugin_dir = dirname($base . PLUGINDIR . "/$plugin");
|
||||
$plugin_dir = trailingslashit($plugin_dir);
|
||||
// If plugin is in its own directory, recursively delete the directory.
|
||||
if ( '.' != $plugin_dir && $base . PLUGINDIR != $plugin_dir )
|
||||
if( ! in_array( $plugin_dir, array('.', trailingslashit($base . PLUGINDIR) ) ) )
|
||||
$deleted = $wp_filesystem->delete($plugin_dir, true);
|
||||
else
|
||||
$deleted = $wp_filesystem->delete($base . PLUGINDIR . "/$plugin");
|
||||
|
Loading…
Reference in New Issue
Block a user