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

WordPress Trac noreply at wordpress.org
Mon Oct 27 09:43:33 UTC 2014


#30121: wpmu_delete_blog function clears the whole uploads directory
--------------------------------+-----------------------------
 Reporter:  katazina            |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:  4.0
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 Hi,

 I have a wordpress multisite, which was installed a long time ago, when
 blogs data was saved to the blogs.dir directory.
 The wordpress core is always up to date, but in the documentation was
 described, that we have to keep the blogs.dir directory when we updated
 the core.
 So my wordpress version is now the latest 4.0 and I still have the
 blogs.dir. And all media of all blogs is there.
 Directory structure like:

 {{{
 - blogs.dir
   |- 12 <-- this is the id of the blog
      |- 2014
        |- 01
        |- 02
        |- ...
   |- 13
      |- 2013
      |- 2014
   |- ...
 }}}


 The problem is with site (blog) deleting.

 What I do:
 - I'm on the /wp-admin/network/sites.php
 - I click on the "Delete" link under a selected blog.
 - Then I'm on the delete confirmation page: /wp-
 admin/network/sites.php?action=confirm&action2=deleteblog&id=...

 If I click once on the comfirm button, then everythings works just fine.
 But it could happen accidentally, that you click twice on that button and
 here comes the problem, becuase then everything in the uploads directory
 will be deleted.

 I tried it with a fresh new multisite install. I donwloaded an old version
 of wp, when blogs.dir was used, then updated the wp to the latest version.
 I created multiple blogs, then deleted one and clicked twice on the
 confirm button. Same happened, the whole uploads directory cleared.

 It's not a new bug, I just didn't know up to now where to report it.

 I'm not entirely sure, that the bug is in the wpmu_delete_blog function,
 but it looks like, because if I click on the confirm button second time,
 then the blog data doesn't exists anymore, so the function fails.
 And then in the wp-admin/includes/ms.php from line 124 will clear the
 whole content of the uploads directory.

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


More information about the wp-trac mailing list