[wp-trac] [WordPress Trac] #21780: Mssing closdir call in wpmu_delete_blog

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 3 16:17:54 UTC 2012


#21780: Mssing closdir call in wpmu_delete_blog
--------------------------+------------------------------------------------
 Reporter:  timfs         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Multisite     |    Version:  3.4.1
 Severity:  normal        |   Keywords:  opendir rmdir multisite deleteblog
--------------------------+------------------------------------------------
 wpmu_delete_blog() tries to recursively delete files and folders in the
 blogs upload directory, but after stacking the directories to delete, it
 doesn't close the directory handle.

 Leaving a directory handle open can have nasty side effects, on my local
 windows development server for example it causes folders not being deleted
 "fast" enough, ie the folder still exists when trying to delete the parent
 folder. Might be a cache issue, maybe it's really not yet deleted (they
 might not be deleted until the open handle gets automatically closed when
 the script shuts down), or whatever.

 Also see comments regarding windows and opendir in the PHP manual for
 rmdir: http://php.net/manual/de/function.rmdir.php

 I really don't like to suppress errors, however since there are already @s
 anywhere, it's in the patch too.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21780>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list