Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#47958 closed defect (bug) (fixed)

Incorrect test result for permission check of uploads directory if it doesn't exist yet

Reported by: ocean90's profile ocean90 Owned by: ocean90's profile ocean90
Milestone: 5.3 Priority: normal
Severity: normal Version: 5.2
Component: Site Health Keywords: has-patch commit
Focuses: Cc:

Description (last modified by ocean90)

wp_get_upload_dir() returns the theoretical path of the uploads directory. When there was no upload yet the test returns an incorrect result (not writeable) because the directory doesn't exist.

Switching to wp_upload_dir(), which creates the directory on the fly, ensures a proper test result.

Attachments (1)

47958.diff (587 bytes) - added by ocean90 6 years ago.

Download all attachments as: .zip

Change History (5)

@ocean90
6 years ago

#1 @afragen
6 years ago

This looks like an easy win.

#2 @Clorith
6 years ago

  • Keywords commit added

#3 @ocean90
6 years ago

  • Description modified (diff)

#4 @ocean90
6 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 46228:

Site Health: Replace wp_get_upload_dir() with wp_upload_dir().

wp_get_upload_dir() returns the theoretical path of the uploads directory. When there was no upload yet the test returns an incorrect result (not writeable) because the directory doesn't exist. Switching to wp_upload_dir(), which creates the directory on the fly, ensures a proper test result.

Fixes #47958.

Note: See TracTickets for help on using tickets.