summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-admin/admin-functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-10-28 12:27:48 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-10-28 12:27:48 +0000
commitdca76ad19c0cc8299b9bc32f6db8d13b5542717b (patch)
treea870bacf5fc98f6d01bd3280d5c43b3e22a406a6 /wp-inst/wp-admin/admin-functions.php
parent3335ee3f39fd50d52cfacf11de8f83a07dfe91bf (diff)
Massive WP merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@414 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/admin-functions.php')
-rw-r--r--wp-inst/wp-admin/admin-functions.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php
index b2530a5..cdfbd37 100644
--- a/wp-inst/wp-admin/admin-functions.php
+++ b/wp-inst/wp-admin/admin-functions.php
@@ -1505,12 +1505,16 @@ function wp_upload_dir() {
$dir = 'wp-content/uploads';
$path = ABSPATH . $dir;
+
+ // Give the new dirs the same perms as wp-content.
+ $stat = stat(ABSPATH . 'wp-content');
+ $dir_perms = $stat['mode'] & 0000777; // Get the permission bits.
// Make sure we have an uploads dir
if ( ! file_exists( $path ) ) {
if ( ! mkdir( $path ) )
return array('error' => "Unable to create directory $path. Is its parent directory writable by the server?");
- @ chmod( ABSPATH . $path, 0774 );
+ @ chmod( $path, $dir_perms );
}
// Generate the yearly and monthly dirs
@@ -1524,14 +1528,14 @@ function wp_upload_dir() {
if ( ! file_exists( $pathy ) ) {
if ( ! mkdir( $pathy ) )
return array('error' => "Unable to create directory $pathy. Is $path writable?");
- @ chmod( $pathy, 0774 );
+ @ chmod( $pathy, $dir_perms );
}
// Make sure we have a monthly dir
if ( ! file_exists( $pathym ) ) {
if ( ! mkdir( $pathym ) )
return array('error' => "Unable to create directory $pathym. Is $pathy writable?");
- @ chmod( $pathym, 0774 );
+ @ chmod( $pathym, $dir_perms );
}
$uploads = array('path' => $pathym, 'url' => get_option('siteurl') . "/$dir/$y/$m", 'error' => false);