]> 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 d48b28f955043ec347dd87879a789c0830dfa5ab..859c390663dd1ea605d135fa37a6bad1a0015005 100644 (file)
@@ -23,6 +23,7 @@ sub getsetup () {
 }
 
 sub allowed_dirs {
 }
 
 sub allowed_dirs {
+       no warnings 'once';
        return grep { defined $_ } (
                $config{srcdir},
                $IkiWiki::Plugin::transient::transientdir,
        return grep { defined $_ } (
                $config{srcdir},
                $IkiWiki::Plugin::transient::transientdir,
@@ -195,7 +196,9 @@ sub formbuilder (@) {
                my $session=$params{session};
 
                if ($form->submitted eq "Remove" && $form->field("do") eq "edit") {
                my $session=$params{session};
 
                if ($form->submitted eq "Remove" && $form->field("do") eq "edit") {
-                       removal_confirm($q, $session, 0, $form->field("page"));
+                       # deliberately taking multiple values of page
+                       my @pages = $form->field("page");
+                       removal_confirm($q, $session, 0, @pages);
                }
                elsif ($form->submitted eq "Remove Attachments") {
                        my @selected=map { Encode::decode_utf8($_) } $q->param("attachment_select");
                }
                elsif ($form->submitted eq "Remove Attachments") {
                        my @selected=map { Encode::decode_utf8($_) } $q->param("attachment_select");
@@ -215,14 +218,15 @@ sub sessioncgi ($$) {
                my ($form, $buttons)=confirmation_form($q, $session);
                IkiWiki::decode_form_utf8($form);
 
                my ($form, $buttons)=confirmation_form($q, $session);
                IkiWiki::decode_form_utf8($form);
 
+               # deliberately taking multiple values of page
+               my @pages = $form->field("page");
+
                if ($form->submitted eq 'Cancel') {
                        postremove($session);
                }
                elsif ($form->submitted eq 'Remove' && $form->validate) {
                if ($form->submitted eq 'Cancel') {
                        postremove($session);
                }
                elsif ($form->submitted eq 'Remove' && $form->validate) {
-                       IkiWiki::checksessionexpiry($q, $session, $q->param('sid'));
+                       IkiWiki::checksessionexpiry($q, $session);
 
 
-                       my @pages=$form->field("page");
-                       
                        # Validate removal by checking that the page exists,
                        # and that the user is allowed to edit(/remove) it.
                        my @files;
                        # Validate removal by checking that the page exists,
                        # and that the user is allowed to edit(/remove) it.
                        my @files;
@@ -287,7 +291,7 @@ sub sessioncgi ($$) {
                        }
                }
                else {
                        }
                }
                else {
-                       removal_confirm($q, $session, 0, $form->field("page"));
+                       removal_confirm($q, $session, 0, @pages);
                }
 
                exit 0;
                }
 
                exit 0;