Make WordPress Core


Ignore:
Timestamp:
10/28/2005 01:12:54 AM (20 years ago)
Author:
ryan
Message:

Create upload dirs with same perms as wp-content. fixes #1784 #1726

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r2958 r2967  
    15061506
    15071507    $path = ABSPATH . $dir;
     1508   
     1509    // Give the new dirs the same perms as wp-content.
     1510    $stat = stat(ABSPATH . 'wp-content');
     1511    $dir_perms = $stat['mode'] & 0000777;  // Get the permission bits.
    15081512
    15091513        // Make sure we have an uploads dir
     
    15111515                if ( ! mkdir( $path ) )
    15121516                        return array('error' => "Unable to create directory $path. Is its parent directory writable by the server?");
    1513         @ chmod( ABSPATH . $path, 0774 );
     1517        @ chmod( $path, $dir_perms );
    15141518    }
    15151519
     
    15251529                if ( ! mkdir( $pathy ) )
    15261530                        return array('error' => "Unable to create directory $pathy. Is $path writable?");
    1527         @ chmod( $pathy, 0774 );
     1531        @ chmod( $pathy, $dir_perms );
    15281532    }
    15291533
     
    15321536                if ( ! mkdir( $pathym ) )
    15331537                        return array('error' => "Unable to create directory $pathym. Is $pathy writable?");
    1534         @ chmod( $pathym, 0774 );
     1538        @ chmod( $pathym, $dir_perms );
    15351539    }
    15361540
Note: See TracChangeset for help on using the changeset viewer.