diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index f5457a56ec..aebc40ee91 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -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 ); } diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php index 50ecafae1d..7eaf24e203 100644 --- a/src/wp-admin/includes/update-core.php +++ b/src/wp-admin/includes/update-core.php @@ -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 ); }