diff options
-rw-r--r-- | inc/media.php | 2 | ||||
-rw-r--r-- | lib/exe/ajax.php | 20 |
2 files changed, 1 insertions, 21 deletions
diff --git a/inc/media.php b/inc/media.php index fe155f0f3..a6109f785 100644 --- a/inc/media.php +++ b/inc/media.php @@ -284,7 +284,7 @@ function media_upload_xhr($ns,$auth){ 'copy' ); unlink($path); - if ($tmp) dir_delete($tmp); + if ($tmp) io_rmdir($tmp, true); if (is_array($res)) { msg($res[0], $res[1]); return false; diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index 6e2011cd9..203af9c5b 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -298,26 +298,6 @@ function ajax_mediaupload(){ echo htmlspecialchars($json->encode($result), ENT_NOQUOTES); } -function dir_delete($path) { - if (!is_string($path) || $path == "") return false; - - if (is_dir($path) && !is_link($path)) { - if (!$dh = @opendir($path)) return false; - - while ($f = readdir($dh)) { - if ($f == '..' || $f == '.') continue; - dir_delete("$path/$f"); - } - - closedir($dh); - return @rmdir($path); - } else { - return @unlink($path); - } - - return false; -} - /** * Return sub index for index view * |