Changeset 25794
- Timestamp:
- 10/15/2013 07:17:56 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/update-core.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/update-core.php
r25793 r25794 693 693 // Don't copy wp-content, we'll deal with that below 694 694 $skip = array( 'wp-content' ); 695 $check_is_writable = array(); 695 696 696 697 // Check to see which files don't really need updating - only available for 3.7 and higher … … 703 704 if ( file_exists( ABSPATH . $file ) && md5_file( ABSPATH . $file ) === $checksum ) 704 705 $skip[] = $file; 706 else 707 $check_is_writable[ $file ] = ABSPATH . $file; 705 708 } 709 } 710 } 711 712 // If we're using the direct method, we can predict write failures that are due to permissions. 713 if ( $wp_filesystem->method === 'direct' ) { 714 $files_writable = array_filter( $check_is_writable, array( $wp_filesystem, 'is_writable' ) ); 715 if ( $files_writable !== $check_is_writable ) { 716 $files_not_writable = array_diff_key( $check_is_writable, $files_writable ); 717 foreach ( $files_not_writable as $relative_file_not_writable => $file_not_writable ) { 718 // If the writable check failed, chmod file to 0644 and try again, same as copy_dir(). 719 $wp_filesystem->chmod( $file_not_writable, FS_CHMOD_FILE ); 720 if ( $wp_filesystem->is_writable( $file_not_writable ) ) 721 unset( $files_not_writable[ $relative_file_not_writable ] ); 722 } 723 724 // Store package-relative paths (the key) of non-writable files in the WP_Error object. 725 if ( $files_not_writable ) 726 return new WP_Error( 'files_not_writable', __( 'Could not copy file.' ), array_keys( $files_not_writable ) ); 706 727 } 707 728 }
Note: See TracChangeset
for help on using the changeset viewer.