Uploads: Fix the Order of Operations for wp_mkdir_p() which caused this branch to never be hit. Props fboender. Fixes #26781 for trunk. See #25822

git-svn-id: https://develop.svn.wordpress.org/trunk@26926 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2014-01-08 23:12:37 +00:00
parent 69848ed0b9
commit 3428afee5a

View File

@ -1378,7 +1378,7 @@ function wp_mkdir_p( $target ) {
if ( @mkdir( $target, $dir_perms, true ) ) {
// If a umask is set that modifies $dir_perms, we'll have to re-set the $dir_perms correctly with chmod()
if ( $dir_perms != $dir_perms & ~umask() ) {
if ( $dir_perms != ( $dir_perms & ~umask() ) ) {
$folder_parts = explode( '/', substr( $target, strlen( $target_parent ) + 1 ) );
for ( $i = 1; $i <= count( $folder_parts ); $i++ ) {
@chmod( $target_parent . '/' . implode( '/', array_slice( $folder_parts, 0, $i ) ), $dir_perms );