﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
23196	mkdir not recursive (in wp-includes/functions.php)	uuf6429		"This January, Wordpress tried to create a directory and a subdirectory in ""uploads"": ""2013"" and inside it ""01"".

`mkdir($target)` was used to create these two directories, but since the $recursive option (3rd argument) was not set, this operation failed.

I have just checked this path and it does exist, hence I suspect this procedure is being done somewhere else (and succeeding).

Still, this is a problem since:
1. It is showing up in our error logging system.
2. It is very easy to fix.
3. It potentially fixes more problems than it seems.

The solution is to change this line:

    1306:        if ( @mkdir( $target ) ) {

To the following:

    1306:        if ( @mkdir( $target, 0777, true ) ) {


On a sidenote, PHP's default directory creation mode is 0777 (so the above code is best for compatibility), but as you may know, it is not good in terms of security, so you may want to look for a more secure fix (eg, lowering the mode if it doesn't cause problems)."	defect (bug)	new	normal	Awaiting Review	Filesystem		normal			
