]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/comments.pm
prune: do not prune beyond an optional base directory, and add a test
[ikiwiki.git] / IkiWiki / Plugin / comments.pm
index 0d5e3c078a9c229b409950c1e65eb1affa3787ac..4bf8ae4692acb85426f4e87fd4134824c5c708d9 100644 (file)
@@ -665,9 +665,11 @@ sub commentmoderation ($$) {
 
                                my $page=IkiWiki::dirname($f);
                                my $file="$config{srcdir}/$f";
+                               my $filedir="$config{srcdir}";
                                if (! -e $file) {
                                        # old location
                                        $file="$config{wikistatedir}/comments_pending/".$f;
+                                       $filedir="$config{wikistatedir}/comments_pending";
                                }
 
                                if ($action eq 'Accept') {
@@ -682,7 +684,7 @@ sub commentmoderation ($$) {
                                }
 
                                require IkiWiki::Render;
-                               IkiWiki::prune($file);
+                               IkiWiki::prune($file, $filedir);
                        }
                }