From 2d9dd4979e85f43677db693fcd856894060642a1 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 8 Jan 2014 23:13:10 +0000 Subject: [PATCH] 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 Built from https://develop.svn.wordpress.org/trunk@26926 git-svn-id: http://core.svn.wordpress.org/trunk@26807 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 05acf4e1ec..9b0335b684 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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 );