From c72ba036cf4a08f03b79ab87a327da736cec71f1 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 15 Oct 2013 19:13:33 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/file.php | 2 +- src/wp-admin/includes/update-core.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ); }