summaryrefslogtreecommitdiff
path: root/inc/media.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/media.php')
-rw-r--r--inc/media.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/inc/media.php b/inc/media.php
index fc8e96d76..3622ea54e 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -165,7 +165,13 @@ function media_delete($id,$auth){
$file = mediaFN($id);
if(@unlink($file)){
msg(str_replace('%s',noNS($id),$lang['deletesucc']),1);
- io_sweepNS($id,'mediadir');
+ $del = io_sweepNS($id,'mediadir');
+ if($del){
+ // current namespace was removed. redirecting to root ns passing msg along
+ header('Location: '.DOKU_URL.'lib/exe/mediamanager.php?msg1='.
+ rawurlencode(str_replace('%s',noNS($id),$lang['deletesucc'])));
+ exit;
+ }
return true;
}
//something went wrong