Use FS_CHMOD_FILE rather than an explicit 0644 in copy_dir() and _copy_dir().

This occurs when we can't copy a file. We chmod it and try again.

see #22704.


git-svn-id: https://develop.svn.wordpress.org/trunk@25793 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-10-15 19:13:33 +00:00
parent 77f48b5d8b
commit c72ba036cf
2 changed files with 2 additions and 2 deletions

View File

@ -789,7 +789,7 @@ function copy_dir($from, $to, $skip_list = array() ) {
if ( 'f' == $fileinfo['type'] ) {
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true, FS_CHMOD_FILE) ) {
// If copy failed, chmod file to 0644 and try again.
$wp_filesystem->chmod($to . $filename, 0644);
$wp_filesystem->chmod( $to . $filename, FS_CHMOD_FILE );
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true, FS_CHMOD_FILE) )
return new WP_Error( 'copy_failed_copy_dir', __( 'Could not copy file.' ), $to . $filename );
}

View File

@ -900,7 +900,7 @@ function _copy_dir($from, $to, $skip_list = array() ) {
if ( 'f' == $fileinfo['type'] ) {
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true, FS_CHMOD_FILE) ) {
// If copy failed, chmod file to 0644 and try again.
$wp_filesystem->chmod($to . $filename, 0644);
$wp_filesystem->chmod( $to . $filename, FS_CHMOD_FILE );
if ( ! $wp_filesystem->copy($from . $filename, $to . $filename, true, FS_CHMOD_FILE) )
return new WP_Error( 'copy_failed__copy_dir', __( 'Could not copy file.' ), $to . $filename );
}