Skip to content
Snippets Groups Projects
Commit 755f1e03 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

clean media directories after medeia deletion FS#734

darcs-hash:20060307184706-7ad00-c57e9e6c54879afaf17858fe642478fcb91af983.gz
parent 9f3cdec3
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment