X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/ffec6806087981420eaf83c8d83cc4523a46d0de..7a88638c6c47480817fdac02d0a45f1dd56b6d1d:/IkiWiki/Plugin/poll.pm diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm index bc1e3501e..2773486a6 100644 --- a/IkiWiki/Plugin/poll.pm +++ b/IkiWiki/Plugin/poll.pm @@ -17,6 +17,7 @@ sub getsetup () { plugin => { safe => 1, rebuild => undef, + section => "widget", }, } @@ -51,7 +52,7 @@ sub preprocess (@) { foreach my $choice (@choices) { if ($open && exists $config{cgiurl}) { # use POST to avoid robots - $ret.="
\n"; + $ret.="\n"; } my $percent=$total > 0 ? int($choices{$choice} / $total * 100) : 0; $ret.="

\n"; @@ -102,7 +103,7 @@ sub sessioncgi ($$) { my $oldchoice=$session->param($choice_param); if (defined $oldchoice && $oldchoice eq $choice) { # Same vote; no-op. - IkiWiki::redirect($cgi, urlto($page, undef, 1)); + IkiWiki::redirect($cgi, urlto($page)); exit; } @@ -133,9 +134,12 @@ sub sessioncgi ($$) { $oldchoice=$session->param($choice_param); if ($config{rcs}) { IkiWiki::disable_commit_hook(); - IkiWiki::rcs_commit($pagesources{$page}, "poll vote ($choice)", - IkiWiki::rcs_prepedit($pagesources{$page}), - $session->param("name"), $ENV{REMOTE_ADDR}); + IkiWiki::rcs_commit( + file => $pagesources{$page}, + message => "poll vote ($choice)", + token => IkiWiki::rcs_prepedit($pagesources{$page}), + session => $session, + ); IkiWiki::enable_commit_hook(); IkiWiki::rcs_update(); } @@ -149,7 +153,7 @@ sub sessioncgi ($$) { error($@) if $@; my $cookie = CGI::Cookie->new(-name=> $session->name, -value=> $session->id); print $cgi->redirect(-cookie => $cookie, - -url => urlto($page, undef, 1)); + -url => urlto($page)); exit; } }