diff options
-rw-r--r-- | inc/io.php | 4 | ||||
-rw-r--r-- | lib/exe/media.php | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/inc/io.php b/inc/io.php index 9160f4718..1d458ace9 100644 --- a/inc/io.php +++ b/inc/io.php @@ -16,12 +16,12 @@ * @todo use safemode hack * @author Andreas Gohr <andi@splitbrain.org> */ -function io_sweepNS($id){ +function io_sweepNS($id,$basedir='datadir'){ global $conf; //scan all namespaces while(($id = getNS($id)) !== false){ - $dir = $conf['datadir'].'/'.utf8_encodeFN(str_replace(':','/',$id)); + $dir = $conf[$basedir].'/'.utf8_encodeFN(str_replace(':','/',$id)); //try to delete dir else return if(!@rmdir($dir)) return; diff --git a/lib/exe/media.php b/lib/exe/media.php index ae0b6efe7..144cd19f4 100644 --- a/lib/exe/media.php +++ b/lib/exe/media.php @@ -82,6 +82,7 @@ function media_delete($delid){ $file = mediaFN($delid); if(@unlink($file)){ msg(str_replace('%s',noNS($delid),$lang['deletesucc']),1); + io_sweepNS($delid,'mediadir'); return true; } //something went wrong |