Changeset 33209
- Timestamp:
- 07/13/2015 07:45:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-upgrader.php
r32963 r33209 302 302 * 303 303 * @param string $remote_destination The location on the remote filesystem to be cleared 304 * 305 * @return bool|WP_Error true upon success, {@see WP_Error} on failure. 304 * @return bool|WP_Error True upon success, WP_Error on failure. 306 305 */ 307 306 public function clear_destination( $remote_destination ) { … … 312 311 } 313 312 314 // Check all files are writable before attempting to clear the destination 313 // Check all files are writable before attempting to clear the destination. 315 314 $unwritable_files = array(); 316 315 317 316 $_files = $wp_filesystem->dirlist( $remote_destination, true, true ); 318 // Flatten the resulting array, iterate using each as we append to the array during iteration 317 318 // Flatten the resulting array, iterate using each as we append to the array during iteration. 319 319 while ( $f = each( $_files ) ) { 320 320 $file = $f['value']; … … 330 330 } 331 331 332 // Check writability 332 // Check writability. 333 333 foreach ( $_files as $filename => $file_details ) { 334 334 if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) { 335 // Attempt to alter permissions to allow writes and try again 335 336 // Attempt to alter permissions to allow writes and try again. 336 337 $wp_filesystem->chmod( $remote_destination . $filename, ( 'd' == $file_details['type'] ? FS_CHMOD_DIR : FS_CHMOD_FILE ) ); 337 338 if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {
Note: See TracChangeset
for help on using the changeset viewer.