Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20411 closed defect (bug) (invalid)

wp_mkdir_p() returning false for is_dir( dirname( $target ) )

Reported by: haro-g's profile Haro G Owned by: harogharbigigmailcom's profile harogharbigi@…
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: General Keywords:
Focuses: Cc:


this condition should return true.

When calling wp_upload_dir() it returns an error if the dir already exists.

Change History (1)

#1 @duck_
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

is_dir( dirname( $target ) ) returns false because the function was unable to create the $target directory even though the parent directory already exists. This is the correct behaviour.

True is returned when the $target already exists and is a directory:

if ( file_exists( $target ) )
    return @is_dir( $target );

Closing as invalid. Please re-open if I misunderstood.

Note: See TracTickets for help on using tickets.