Changeset 10050 for trunk/wp-admin/includes/file.php
- Timestamp:
- 12/04/2008 09:58:46 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/file.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r10048 r10050 499 499 for ( $i = $i + 1; $i <= count($path); $i++ ) { 500 500 $tmppath = implode('/', array_slice($path, 0, $i) ); 501 if ( ! $fs->mkdir($tmppath, 0755) )501 if ( ! $fs->mkdir($tmppath, FS_CHMOD_DIR) ) 502 502 return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath); 503 503 } … … 517 517 for ( $i = $i + 1; $i <= count($path); $i++ ) { //< count() no file component please. 518 518 $tmppath = $to . implode('/', array_slice($path, 0, $i) ); 519 if ( ! $fs->is_dir($tmppath) && ! $fs->mkdir($tmppath, 0755) )519 if ( ! $fs->is_dir($tmppath) && ! $fs->mkdir($tmppath, FS_CHMOD_DIR) ) 520 520 return new WP_Error('mkdir_failed', __('Could not create directory'), $tmppath); 521 521 } … … 528 528 if ( !$fs->put_contents( $to . $file['filename'], $file['content']) ) 529 529 return new WP_Error('copy_failed', __('Could not copy file'), $to . $file['filename']); 530 $fs->chmod($to . $file['filename'], 0644);530 $fs->chmod($to . $file['filename'], FS_CHMOD_FILE); 531 531 } 532 532 } … … 559 559 return new WP_Error('copy_failed', __('Could not copy file'), $to . $filename); 560 560 } 561 $wp_filesystem->chmod($to . $filename, 0644);561 $wp_filesystem->chmod($to . $filename, FS_CHMOD_FILE); 562 562 } elseif ( 'd' == $fileinfo['type'] ) { 563 563 if ( !$wp_filesystem->is_dir($to . $filename) ) { 564 if ( !$wp_filesystem->mkdir($to . $filename, 0755) )564 if ( !$wp_filesystem->mkdir($to . $filename, FS_CHMOD_DIR) ) 565 565 return new WP_Error('mkdir_failed', __('Could not create directory'), $to . $filename); 566 566 } … … 604 604 if ( !$wp_filesystem->connect() ) 605 605 return false; //There was an erorr connecting to the server. 606 607 // Set the permission constants if not already set. 608 if ( ! defined('FS_CHMOD_DIR') ) 609 define('FS_CHMOD_DIR', 0755 ); 610 if ( ! defined('FS_CHMOD_FILE') ) 611 define('FS_CHMOD_FILE', 0644 ); 606 612 607 613 return true;
Note: See TracChangeset
for help on using the changeset viewer.