diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-22 15:49:26 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-22 15:49:26 +0000 |
commit | 1c0a4f665c18d62ff513f5767db19075c6e24a36 (patch) | |
tree | bea99c597b02e58b21787207e3b92ff376abd86d /wp-admin | |
parent | b2f9804dae80c5f6c70c70e92a3bbde67e2615c5 (diff) | |
download | wordpress-mu-1c0a4f665c18d62ff513f5767db19075c6e24a36.tar.gz wordpress-mu-1c0a4f665c18d62ff513f5767db19075c6e24a36.tar.xz wordpress-mu-1c0a4f665c18d62ff513f5767db19075c6e24a36.zip |
Don't delete the admin's files too! (fixes #224)
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@855 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin')
-rw-r--r-- | wp-admin/admin-db.php | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php index eab830e..83ff94b 100644 --- a/wp-admin/admin-db.php +++ b/wp-admin/admin-db.php @@ -533,31 +533,31 @@ function wpmu_delete_blog($blog_id, $drop = false) { if ( $drop ) { $drop_tables = array( $wpmuBaseTablePrefix . $blog_id . "_categories", - $wpmuBaseTablePrefix . $blog_id . "_comments", - $wpmuBaseTablePrefix . $blog_id . "_linkcategories", - $wpmuBaseTablePrefix . $blog_id . "_links", - $wpmuBaseTablePrefix . $blog_id . "_link2cat", - $wpmuBaseTablePrefix . $blog_id . "_options", - $wpmuBaseTablePrefix . $blog_id . "_post2cat", - $wpmuBaseTablePrefix . $blog_id . "_postmeta", - $wpmuBaseTablePrefix . $blog_id . "_posts", - $wpmuBaseTablePrefix . $blog_id . "_referer_visitLog", - $wpmuBaseTablePrefix . $blog_id . "_referer_blacklist" ); + $wpmuBaseTablePrefix . $blog_id . "_comments", + $wpmuBaseTablePrefix . $blog_id . "_linkcategories", + $wpmuBaseTablePrefix . $blog_id . "_links", + $wpmuBaseTablePrefix . $blog_id . "_link2cat", + $wpmuBaseTablePrefix . $blog_id . "_options", + $wpmuBaseTablePrefix . $blog_id . "_post2cat", + $wpmuBaseTablePrefix . $blog_id . "_postmeta", + $wpmuBaseTablePrefix . $blog_id . "_posts", + $wpmuBaseTablePrefix . $blog_id . "_referer_visitLog", + $wpmuBaseTablePrefix . $blog_id . "_referer_blacklist" ); reset( $drop_tables ); while( list( $key, $val ) = each( $drop_tables ) ) $wpdb->query( "DROP TABLE IF EXISTS $val" ); $wpdb->query( "DELETE FROM $wpdb->blogs WHERE blog_id = '$blog_id'" ); - $dir = constant( "ABSPATH" ) . constant( "UPLOADS" ); - $dir = rtrim($dir, DIRECTORY_SEPARATOR); - $top_dir = $dir; - $stack = array($dir); - $index = 0; + $dir = constant( "ABSPATH" ) . "wp-content/blogs.dir/" . $blog_id ."/files/" + $dir = rtrim($dir, DIRECTORY_SEPARATOR); + $top_dir = $dir; + $stack = array($dir); + $index = 0; - while ($index < count($stack)) { - # Get indexed directory from stack - $dir = $stack[$index]; + while ($index < count($stack)) { + # Get indexed directory from stack + $dir = $stack[$index]; $dh = @ opendir($dir); if ($dh) { @@ -572,13 +572,13 @@ function wpmu_delete_blog($blog_id, $drop = false) { } } $index++; - } + } - $stack = array_reverse($stack); // Last added dirs are deepest - foreach($stack as $dir) { - if ( $dir != $top_dir) - @ rmdir($dir); - } + $stack = array_reverse($stack); // Last added dirs are deepest + foreach($stack as $dir) { + if ( $dir != $top_dir) + @ rmdir($dir); + } } if ( $switch ) |