diff options
author | Andreas Gohr <andi@splitbrain.org> | 2014-02-22 09:02:05 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2014-02-22 09:02:05 +0100 |
commit | 1f6db5384572c0096806dbdf31b33bc979077be1 (patch) | |
tree | 5811d0a299393b1927f5b45f1a5f1d2f8627d801 | |
parent | 6ffaeda954351208754898acc6e2ff228f3ae472 (diff) | |
parent | 900a9e9e56d360fa7d347304e9b0d4b691d4becc (diff) | |
download | rpg-1f6db5384572c0096806dbdf31b33bc979077be1.tar.gz rpg-1f6db5384572c0096806dbdf31b33bc979077be1.tar.bz2 |
Merge pull request #561 from splitbrain/dir_delete
replace dir_delete by io_rmdir
-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 6d5bf461b..4fff95d94 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 2cbcece5e..1000094bc 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -306,26 +306,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 * |