[wp-trac] [WordPress Trac] #30121: wpmu_delete_blog function clears the whole uploads directory

WordPress Trac noreply at wordpress.org
Mon Nov 3 04:58:54 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:  has-patch           |     Focuses:  multisite
--------------------------------+-------------------------
Changes (by jeremyfelt):

 * keywords:  needs-patch => has-patch


Comment:

 In [https://core.trac.wordpress.org/attachment/ticket/30121/30121.diff
 30121.diff]:

 * Test for the existence of `$blog` before trying to drop anything. If
 `get_blog_details()` has returned false, we should be able to assume that
 no dropping will take place.
 * Test for a non empty `upload_path` if `ms_files_rewriting` is enabled.
 If `upload_path` is empty in this scenario, we cannot be confident in the
 response of `wp_upload_dir()`.
 * Move the call to `wp_upload_dir()` above the deletion of the site's
 options tables. If the `upload_path` option is not cached and the tables
 are deleted, an empty `upload_dir` will be provided which results in the
 deletion of the main site files.
 * Add unit tests for a double `wpmu_delete_blog()` fire.

 **BUT**

 As soon as we set `ms_upload_constants()` here, another test fails as
 things are polluted all over the place. I've commented those out for now -
 it may be worth setting up another tests file for `ms_files_rewriting`
 specific tests.

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


More information about the wp-trac mailing list