From ef093b8caf58b9506ec7d6bb4d92a1c0d81e7153 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 5 Nov 2008 17:35:58 +0000 Subject: [PATCH] Set perms when making plugin dirs. see #7395 git-svn-id: http://svn.automattic.com/wordpress/trunk@9524 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/plugin-install.php | 11 ++++++----- wp-admin/includes/update.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index 1402ab2b71..5503ffe8fc 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -753,7 +753,7 @@ function wp_install_plugin($package, $feedback = '') { //Create folder if not exists. if( ! $wp_filesystem->exists( $res['to'] ) ) - if ( ! $wp_filesystem->mkdir( $res['to'] ) ) + if ( ! $wp_filesystem->mkdir( $res['to'], 0755 ) ) return new WP_Error('mkdir_failed', __('Could not create directory'), $res['to']); // Copy new version of plugin into place. @@ -844,10 +844,11 @@ function wp_install_plugin_local_package($package, $feedback = '') { $res = update_pluginfiles_base_dir($working_dir . '/' . $filelist[0], $plugins_dir . $filelist[0]); //Create folder if not exists. - if( ! $wp_filesystem->exists( $res['to'] ) ) - if ( ! $wp_filesystem->mkdir( $res['to'] ) ) - return new WP_Error('mkdir_failed', __('Could not create directory'), $res['to']); - + if( ! $wp_filesystem->exists( $res['to'] ) ) { + if ( ! $wp_filesystem->mkdir( $res['to'], 0755 ) ) + return new WP_Error('mkdir_failed', __('Could not create directory'), $res['to']); + } + // Copy new version of plugin into place. $result = copy_dir($res['from'], $res['to']); if ( is_wp_error($result) ) { diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 8392e006f3..f9daafb112 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -254,7 +254,7 @@ function wp_update_plugin($plugin, $feedback = '') { //Create folder if not exists. if( ! $wp_filesystem->exists( $res['to'] ) ) - if ( ! $wp_filesystem->mkdir( $res['to'] ) ) + if ( ! $wp_filesystem->mkdir( $res['to'], 0755 ) ) return new WP_Error('mkdir_failed', __('Could not create directory'), $res['to']); // Copy new version of plugin into place.