Changeset 8009 for trunk/wp-admin/includes/file.php
- Timestamp:
- 05/29/2008 05:29:32 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/file.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r7999 r8009 35 35 function get_real_file_to_edit( $file ) { 36 36 if ('index.php' == $file || '.htaccess' == $file ) { 37 $real_file = get_home_path() .$file;37 $real_file = get_home_path() . $file; 38 38 } else { 39 $real_file = ABSPATH .$file;39 $real_file = ABSPATH . $file; 40 40 } 41 41 … … 257 257 if ( ! $fs->is_dir($to . $tmppath) ) 258 258 if ( !$fs->mkdir($to . $tmppath, 0755) ) 259 return new WP_Error('mkdir_failed', __('Could not create directory') );259 return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $tmppath); 260 260 } 261 261 … … 263 263 if ( ! $file['folder'] ) 264 264 if ( !$fs->put_contents( $to . $file['filename'], $file['content']) ) 265 return new WP_Error('copy_failed', __('Could not copy file') );265 return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']); 266 266 $fs->chmod($to . $file['filename'], 0644); 267 267 } … … 281 281 if ( 'f' == $fileinfo['type'] ) { 282 282 if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true) ) 283 return false;283 return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename); 284 284 $wp_filesystem->chmod($to . $filename, 0644); 285 285 } elseif ( 'd' == $fileinfo['type'] ) { 286 286 if ( !$wp_filesystem->mkdir($to . $filename, 0755) ) 287 return false; 288 if ( !copy_dir($from . $filename, $to . $filename) ) 289 return false; 287 return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename); 288 $result = copy_dir($from . $filename, $to . $filename); 289 if ( is_wp_error($result) ) 290 return $result; 290 291 } 291 292 } 292 293 return true;294 293 } 295 294 296 295 function WP_Filesystem( $args = false ) { 297 296 global $wp_filesystem; 297 298 require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); 298 299 299 300 $method = get_filesystem_method();
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)