mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
Parse absolute paths out of error data. see #22704.
git-svn-id: https://develop.svn.wordpress.org/trunk@25780 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -645,7 +645,7 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
|
||||
// Create those directories if need be:
|
||||
foreach ( $needed_dirs as $_dir ) {
|
||||
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.
|
||||
return new WP_Error( 'mkdir_failed_ziparchive', __( 'Could not create directory.' ), $_dir );
|
||||
return new WP_Error( 'mkdir_failed_ziparchive', __( 'Could not create directory.' ), substr( $_dir, strlen( $to ) ) );
|
||||
}
|
||||
unset($needed_dirs);
|
||||
|
||||
@@ -664,7 +664,7 @@ function _unzip_file_ziparchive($file, $to, $needed_dirs = array() ) {
|
||||
return new WP_Error( 'extract_failed_ziparchive', __( 'Could not extract file from archive.' ), $info['name'] );
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $to . $info['name'], $contents, FS_CHMOD_FILE) )
|
||||
return new WP_Error( 'copy_failed_ziparchive', __( 'Could not copy file.' ), $to . $info['name'] );
|
||||
return new WP_Error( 'copy_failed_ziparchive', __( 'Could not copy file.' ), $info['name'] );
|
||||
}
|
||||
|
||||
$z->close();
|
||||
@@ -744,8 +744,8 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
|
||||
|
||||
// Create those directories if need be:
|
||||
foreach ( $needed_dirs as $_dir ) {
|
||||
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.
|
||||
return new WP_Error( 'mkdir_failed_pclzip', __( 'Could not create directory.' ), $_dir );
|
||||
// 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.
|
||||
return new WP_Error( 'mkdir_failed_pclzip', __( 'Could not create directory.' ), substr( $_dir, strlen( $to ) ) );
|
||||
}
|
||||
unset($needed_dirs);
|
||||
|
||||
@@ -758,7 +758,7 @@ function _unzip_file_pclzip($file, $to, $needed_dirs = array()) {
|
||||
continue;
|
||||
|
||||
if ( ! $wp_filesystem->put_contents( $to . $file['filename'], $file['content'], FS_CHMOD_FILE) )
|
||||
return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $to . $file['filename'] );
|
||||
return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $file['filename'] );
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user