Changeset 25780
- Timestamp:
- 10/14/2013 10:24:28 PM (11 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r25779 r25780 646 646 foreach ( $needed_dirs as $_dir ) { 647 647 if ( ! $wp_filesystem->mkdir($_dir, FS_CHMOD_DIR) && ! $wp_filesystem->is_dir($_dir) ) // Only check to see if the Dir exists upon creation failure. Less I/O this way. 648 return new WP_Error( 'mkdir_failed_ziparchive', __( 'Could not create directory.' ), $_dir);648 return new WP_Error( 'mkdir_failed_ziparchive', __( 'Could not create directory.' ), substr( $_dir, strlen( $to ) ) ); 649 649 } 650 650 unset($needed_dirs); … … 665 665 666 666 if ( ! $wp_filesystem->put_contents( $to . $info['name'], $contents, FS_CHMOD_FILE) ) 667 return new WP_Error( 'copy_failed_ziparchive', __( 'Could not copy file.' ), $ to . $info['name'] );667 return new WP_Error( 'copy_failed_ziparchive', __( 'Could not copy file.' ), $info['name'] ); 668 668 } 669 669 … … 745 745 // Create those directories if need be: 746 746 foreach ( $needed_dirs as $_dir ) { 747 if ( ! $wp_filesystem->mkdir($_dir, FS_CHMOD_DIR) && ! $wp_filesystem->is_dir($_dir) ) // Only check to see if the dir exists upon creation failure. Less I/O this way.748 return new WP_Error( 'mkdir_failed_pclzip', __( 'Could not create directory.' ), $_dir);747 // if ( ! $wp_filesystem->mkdir($_dir, FS_CHMOD_DIR) && ! $wp_filesystem->is_dir($_dir) ) // Only check to see if the dir exists upon creation failure. Less I/O this way. 748 return new WP_Error( 'mkdir_failed_pclzip', __( 'Could not create directory.' ), substr( $_dir, strlen( $to ) ) ); 749 749 } 750 750 unset($needed_dirs); … … 759 759 760 760 if ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE) ) 761 return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $ to . $file['filename'] );761 return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] ); 762 762 } 763 763 return true; -
trunk/src/wp-admin/includes/update-core.php
r25778 r25780 717 717 // Copy new versions of WP files into place. 718 718 $result = _copy_dir( $from . $distro, $to, $skip ); 719 if ( is_wp_error( $result ) ) 720 $result = new WP_Error( $result->get_error_code(), $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) ); 719 721 720 722 // Check to make sure everything copied correctly, ignoring the contents of wp-content … … 745 747 $available_space = disk_free_space( ABSPATH ); 746 748 if ( $available_space && $total_size >= $available_space ) { 747 $result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ) , $to);749 $result = new WP_Error( 'disk_full', __( 'There is not enough free disk space to complete the update.' ) ); 748 750 } else { 749 751 $result = _copy_dir( $from . $distro, $to, $skip ); 750 752 if ( is_wp_error( $result ) ) 751 $result = new WP_Error( $result->get_error_code() . '_retry', $result->get_error_message(), $result->get_error_data() );753 $result = new WP_Error( $result->get_error_code() . '_retry', $result->get_error_message(), substr( $result->get_error_data(), strlen( $to ) ) ); 752 754 } 753 755 } … … 771 773 $result = copy_dir($from . $distro . 'wp-content/languages/', $wp_lang_dir); 772 774 if ( is_wp_error( $result ) ) 773 $result = new WP_Error( $result->get_error_code() . '_languages', $result->get_error_message(), $result->get_error_data() );775 $result = new WP_Error( $result->get_error_code() . '_languages', $result->get_error_message(), substr( $result->get_error_data(), strlen( $wp_lang_dir ) ) ); 774 776 } 775 777 } … … 821 823 if ( ! is_wp_error( $result ) ) 822 824 $result = new WP_Error; 823 $result->add( $_result->get_error_code() . "_$type", $_result->get_error_message(), $_result->get_error_data() );825 $result->add( $_result->get_error_code() . "_$type", $_result->get_error_message(), substr( $_result->get_error_data(), strlen( $dest ) ) ); 824 826 } 825 827 }
Note: See TracChangeset
for help on using the changeset viewer.