note 80360 deleted from function.rmdir by aidan
| From: | aidan@php.net | Date: | Wed, 15 Apr 2009 04:22:29 +0000 |
| Subject: | note 80360 deleted from function.rmdir by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153242@lists.php.net to get a copy of this message | ||
Note Submitter: anders dot carlsson at dwm dot se
----
All of you who proposed routines for recursive deletion of a directory tree, I have one suggestion:
if (is_dir($f) && !is_link($f)) { ... }
Otherwise, if you happen to have a symbolic link to a directory outside of the one you plan to
remove and also have permissions enough to wipe that too, nasty things could happen. It just
happened to me, and I had to retrieve lost files from the backup. :-/