Changeset 25047
- Timestamp:
- 08/17/2013 03:08:50 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r25037 r25047 1337 1337 return @is_dir( $target ); 1338 1338 1339 // Attempting to create the directory may clutter up our display. 1340 if ( @mkdir( $target ) ) { 1341 $stat = @stat( dirname( $target ) ); 1342 $dir_perms = $stat['mode'] & 0007777; // Get the permission bits. 1343 @chmod( $target, $dir_perms ); 1339 // We need to find the permissions of the parent folder that exists and inherit that. 1340 $target_parent = dirname( $target ); 1341 while ( '.' != $target_parent && ! is_dir( $target_parent ) ) { 1342 $target_parent = dirname( $target_parent ); 1343 } 1344 1345 // Get the permission bits. 1346 if ( $target_parent && '.' != $target_parent ) { 1347 $stat = @stat( $target_parent ); 1348 $dir_perms = $stat['mode'] & 0007777; 1349 } else { 1350 $dir_perms = 0777; 1351 } 1352 1353 if ( @mkdir( $target, $dir_perms, true ) ) { 1344 1354 return true; 1345 } elseif ( is_dir( dirname( $target ) ) ) { 1346 return false; 1347 } 1348 1349 // If the above failed, attempt to create the parent node, then try again. 1350 if ( ( $target != '/' ) && ( wp_mkdir_p( dirname( $target ) ) ) ) 1351 return wp_mkdir_p( $target ); 1355 } 1352 1356 1353 1357 return false;
Note: See TracChangeset
for help on using the changeset viewer.