Changeset 7126 for trunk/wp-admin/includes/update.php
- Timestamp:
- 03/01/2008 09:20:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/update.php
r7076 r7126 159 159 160 160 // Clean up working directory 161 $wp_filesystem->delete($working_dir, true); 161 if ( is_dir($working_dir) ) 162 $wp_filesystem->delete($working_dir, true); 162 163 163 164 apply_filters('update_feedback', __("Unpacking the update")); … … 175 176 // Remove the existing plugin. 176 177 apply_filters('update_feedback', __("Removing the old version of the plugin")); 177 $wp_filesystem->delete(ABSPATH . PLUGINDIR . "/$plugin");178 178 $plugin_dir = dirname(ABSPATH . PLUGINDIR . "/$plugin"); 179 180 179 // If plugin is in its own directory, recursively delete the directory. 181 180 if ( '.' != $plugin_dir && ABSPATH . PLUGINDIR != $plugin_dir ) 182 $wp_filesystem->delete($plugin_dir, true); 181 $deleted = $wp_filesystem->delete($plugin_dir, true); 182 else 183 $deleted = $wp_filesystem->delete(ABSPATH . PLUGINDIR . "/$plugin"); 184 if ( !$deleted ) { 185 $wp_filesystem->delete($working_dir, true); 186 return new WP_Error('delete_failed', __('Could not remove the old plugin')); 187 } 183 188 184 189 apply_filters('update_feedback', __("Installing the latest version")); 185 190 // Copy new version of plugin into place. 186 copy_dir($working_dir, ABSPATH . PLUGINDIR); 191 if ( !copy_dir($working_dir, ABSPATH . PLUGINDIR) ) { 192 //$wp_filesystem->delete($working_dir, true); 193 return new WP_Error('install_failed', __('Installation failed')); 194 } 187 195 188 196 // Remove working directory
Note: See TracChangeset
for help on using the changeset viewer.