[wp-trac] [WordPress Trac] #47958: Incorrect test result for permission check of uploads directory if it doesn't exist yet

WordPress Trac noreply at wordpress.org
Sat Sep 21 15:49:07 UTC 2019


#47958: Incorrect test result for permission check of uploads directory if it
doesn't exist yet
------------------------------+----------------------
 Reporter:  ocean90           |       Owner:  ocean90
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  5.3
Component:  Site Health       |     Version:  5.2
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
------------------------------+----------------------
Changes (by ocean90):

 * owner:  (none) => ocean90
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"46228" 46228]:
 {{{
 #!CommitTicketReference repository="" revision="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.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47958#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list