note 100709 added to function.rmdir
| From: | Tom at osu1 dot php dot net | Date: | Mon, 01 Nov 2010 15:37:42 +0000 |
| Subject: | note 100709 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173662@lists.php.net to get a copy of this message | ||
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.)
----
Server IP: 87.124.126.117
Probable Submitter: 87.194.204.254 (proxied: 87.194.204.254)
----
Manual Page -- http://www.php.net/manual/en/function.rmdir.php
Edit -- https://master.php.net/note/edit/100709
Del: integrated -- https://master.php.net/note/delete/100709/integrated
Del: useless -- https://master.php.net/note/delete/100709/useless
Del: bad code -- https://master.php.net/note/delete/100709/bad+code
Del: spam -- https://master.php.net/note/delete/100709/spam
Del: non-english -- https://master.php.net/note/delete/100709/non-english
Del: in docs -- https://master.php.net/note/delete/100709/in+docs
Del: other reasons-- https://master.php.net/note/delete/100709
Reject -- https://master.php.net/note/reject/100709
Search -- https://master.php.net/manage/user-notes.php