Changeset 25780 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 10/14/2013 10:24:28 PM (11 years ago)
- File:
-
- 1 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;
Note: See TracChangeset
for help on using the changeset viewer.