Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 6 years ago

#21780 closed defect (bug) (fixed)

Missing closedir call in wpmu_delete_blog()

Reported by: timfs Owned by:
Priority: normal Milestone: 3.5
Component: Filesystem API Version: 3.4.1
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

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.

Attachments (1)

ms.php.patch (386 bytes ) - added by timfs 14 years ago.

Download all attachments as: .zip

Change History (9)

#1 @timfs
14 years ago

  • Summary Mssing closdir call in wpmu_delete_blogMissing closdir call in wpmu_delete_blog

#2 @SergeyBiryukov
14 years ago

  • Keywords has-patch added; opendir rmdir multisite deleteblog removed

#3 @scribu
14 years ago

  • Component MultisiteFilesystem
  • Milestone Awaiting Review3.5

#4 @scribu
14 years ago

  • Summary Missing closdir call in wpmu_delete_blogMissing closedir call in wpmu_delete_blog()

@timfs
14 years ago

#5 @timfs
14 years ago

Sorry, there was a typo in the path, ofcouse it should close $dh, not $dir :)

#6 @ryan
14 years ago

  • Resolutionfixed
  • Status newclosed

#7 @jeremyfelt
13 years ago

#19375 was marked as a duplicate.

This ticket was mentioned in Slack in #core-editor by bernhardreiter. View the logs.


6 years ago

Note: See TracTickets for help on using tickets.