diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 484a191022..b4ee8ec105 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -802,9 +802,9 @@ function WP_Filesystem( $args = false, $context = false ) { // Set the permission constants if not already set. if ( ! defined('FS_CHMOD_DIR') ) - define('FS_CHMOD_DIR', 0755 ); + define('FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0750 ) ); if ( ! defined('FS_CHMOD_FILE') ) - define('FS_CHMOD_FILE', 0644 ); + define('FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0640 ) ); return true; }