]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/remove.pm
(no commit message)
[git.ikiwiki.info.git] / IkiWiki / Plugin / remove.pm
index e6f7e1dbd1c530e47a1accccdbcd0232723d52b1..14ac01c9bcfc390f370f1a8fca74c3b51d7f0baa 100644 (file)
@@ -119,17 +119,16 @@ sub removal_confirm ($$@) {
        my @pages=@_;
                
        # Special case for unsaved attachments.
-       @pages=grep {
-               if (IkiWiki::Plugin::attachment->can("is_held_attachment")) {
-                       my $f=IkiWiki::Plugin::attachment::is_held_attachment($_);
+       foreach my $page (@pages) {
+               if ($attachment && IkiWiki::Plugin::attachment->can("is_held_attachment")) {
+                       my $f=IkiWiki::Plugin::attachment::is_held_attachment($page);
                        if (defined $f) {
                                require IkiWiki::Render;
                                IkiWiki::prune($f);
-                               0;
                        }
                }
-               1;
-       } @pages;
+       }
+       @pages=grep { exists $pagesources{$_} } @pages;
        return unless @pages;
 
        foreach my $page (@pages) {