diff options
Diffstat (limited to 'inc/io.php')
-rw-r--r-- | inc/io.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/inc/io.php b/inc/io.php index 30f34ad3c..c5225a2e0 100644 --- a/inc/io.php +++ b/inc/io.php @@ -410,13 +410,14 @@ function io_mkdir_p($target){ */ function io_rmdir($path, $removefiles = false) { if(!is_string($path) || $path == "") return false; + if(!file_exists($path)) return true; // it's already gone or was never there, count as success if(is_dir($path) && !is_link($path)) { $dirs = array(); $files = array(); if(!$dh = @opendir($path)) return false; - while($f = readdir($dh)) { + while(false !== ($f = readdir($dh))) { if($f == '..' || $f == '.') continue; // collect dirs and files first |