Make WordPress Core


Ignore:
Timestamp:
10/14/2013 10:24:28 PM (11 years ago)
Author:
nacin
Message:

Parse absolute paths out of error data. see #22704.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r25779 r25780  
    646646    foreach ( $needed_dirs as $_dir ) {
    647647        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 ) ) );
    649649    }
    650650    unset($needed_dirs);
     
    665665
    666666        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'] );
    668668    }
    669669
     
    745745    // Create those directories if need be:
    746746    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 ) ) );
    749749    }
    750750    unset($needed_dirs);
     
    759759
    760760        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'] );
    762762    }
    763763    return true;
Note: See TracChangeset for help on using the changeset viewer.