[wp-trac] [WordPress Trac] #26920: The 'wpmu_delete_blog' function deletes all main site's files
WordPress Trac
noreply at wordpress.org
Thu Jan 23 23:05:50 UTC 2014
#26920: The 'wpmu_delete_blog' function deletes all main site's files
--------------------------+-----------------------------
Reporter: npetetin | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Multisite | Version: 3.8
Severity: normal | Keywords:
--------------------------+-----------------------------
Hi.
I found a bug in the 'wpmu_delete_blog' function with much impact.
Actually, tables are deleted before the files. But in order to get the
blog's upload directory, the 'wp_upload_dir' function, which primarily
uses the 'upload_path' option, is called when the option doesn't exist
anymore in the database. As a consequence, if that blog option is not
cached at that time, the 'wp_upload_dir' function may return by default
the main site's upload directory, and then all main site's files are
deleted!
A fix is to set the '$uploads' variable before the tables are dropped.
Thanks.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26920>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list