note 100709 deleted from function.rmdir by danbrown

From: Date: Mon, 01 Nov 2010 15:48:30 +0000
Subject: note 100709 deleted from function.rmdir by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-173670@lists.php.net to get a copy of this message
Note Submitter: Tom ---- WARNING: The example using RecursiveIteratorIterator given in the note below is DANGEROUS! It doesn't guard against recursing into '..', and so the deletion will actually extend up into /path/to, /path, and then / and start deleting everything it can get access to. To guard against this, you need to check $dir->isDot() first, and do nothing if true. (Fortunately, I happened to notice this before running it.)

« previous php.notes (#173670) next »