WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#20411 closed defect (bug) (invalid)

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

Reported by: Haro G Owned by: harogharbigi@…
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: General Keywords:
Focuses: Cc:

Description

this condition should return true.

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

Change History (1)

comment:1 duck_2 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.