- # Load saved form state and return to edit page.
- my $postrename=CGI->new($session->param("postrename"));
- $session->clear("postrename");
- IkiWiki::cgi_savesession($session);
+ # Load saved form state and return to edit page, using stored old
+ # cgi state. Or, if the rename was not started on the edit page,
+ # return to the renamed page.
+ my $postrename=$session->param("postrename");