[wp-trac] [WordPress Trac] #30121: wpmu_delete_blog function clears the whole uploads directory
WordPress Trac
noreply at wordpress.org
Tue Oct 28 19:07:56 UTC 2014
#30121: wpmu_delete_blog function clears the whole uploads directory
--------------------------------+-------------------------
Reporter: katazina | Owner: jeremyfelt
Type: defect (bug) | Status: assigned
Priority: high | Milestone: 4.1
Component: Networks and Sites | Version: 3.5
Severity: critical | Resolution:
Keywords: needs-patch | Focuses: multisite
--------------------------------+-------------------------
Changes (by jeremyfelt):
* keywords: => needs-patch
* owner: => jeremyfelt
* version: 4.0 => 3.5
* status: new => assigned
Comment:
Confirmed, this traces back to the ms-files removal in [21823],
specifically the switch from a hard coded `blogs.dir` uploads URL when
deleting a site to the use of `wp_upload_dir()`.
`wp_upload_dir()` doesn't do any check to see if a site exists and
therefor the non-existent options to determine site URL and upload path
return false and result in the default uploads directory being returned.
This kind of makes sense because when one wants a path to upload to, we
should return something.
This doesn't make sense for `wpmu_delete_blog` because if one wants a path
to delete, it should be the right path.
We already use `get_blog_details()` here. I think we can use that to
determine if a site exists before attempting to delete its upload
directory.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30121#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list