Merge commit 'smcv/beautify'
Conflicts: IkiWiki/Plugin/recentchanges.pm Note that smcv's approach of using urlto also gets the url right when redirecting to a non-html file, which is a better approach than my recent fix to recentchangesmaster
commit
7351d545d9
|
@ -95,8 +95,8 @@ sub cgi_editpage ($$) { #{{{
|
|||
error("bad page name");
|
||||
}
|
||||
|
||||
my $baseurl=$config{url}."/".htmlpage($page);
|
||||
|
||||
my $baseurl = urlto($page, undef, 1);
|
||||
|
||||
my $from;
|
||||
if (defined $form->field('from')) {
|
||||
($from)=$form->field('from')=~/$config{wiki_file_regexp}/;
|
||||
|
@ -153,13 +153,13 @@ sub cgi_editpage ($$) { #{{{
|
|||
|
||||
if ($form->submitted eq "Cancel") {
|
||||
if ($form->field("do") eq "create" && defined $from) {
|
||||
redirect($q, "$config{url}/".htmlpage($from));
|
||||
redirect($q, urlto($from, undef, 1));
|
||||
}
|
||||
elsif ($form->field("do") eq "create") {
|
||||
redirect($q, $config{url});
|
||||
}
|
||||
else {
|
||||
redirect($q, "$config{url}/".htmlpage($page));
|
||||
redirect($q, urlto($page, undef, 1));
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ sub cgi_editpage ($$) { #{{{
|
|||
@page_locs=$page;
|
||||
}
|
||||
else {
|
||||
redirect($q, "$config{url}/".htmlpage($page));
|
||||
redirect($q, urlto($page, undef, 1));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
@ -418,7 +418,7 @@ sub cgi_editpage ($$) { #{{{
|
|||
else {
|
||||
# The trailing question mark tries to avoid broken
|
||||
# caches and get the most recent version of the page.
|
||||
redirect($q, "$config{url}/".htmlpage($page)."?updated");
|
||||
redirect($q, urlto($page, undef, 1)."?updated");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ sub sessioncgi ($$) { #{{{
|
|||
my $oldchoice=$session->param($choice_param);
|
||||
if (defined $oldchoice && $oldchoice eq $choice) {
|
||||
# Same vote; no-op.
|
||||
IkiWiki::redirect($cgi, "$config{url}/".htmlpage($page));
|
||||
IkiWiki::redirect($cgi, urlto($page, undef, 1);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ sub sessioncgi ($$) { #{{{
|
|||
error($@) if $@;
|
||||
my $cookie = CGI::Cookie->new(-name=> $session->name, -value=> $session->id);
|
||||
print $cgi->redirect(-cookie => $cookie,
|
||||
-url => "$config{url}/".htmlpage($page));
|
||||
-url => urlto($page, undef, 1));
|
||||
exit;
|
||||
}
|
||||
} #}}}
|
||||
|
|
|
@ -104,12 +104,7 @@ sub cgi ($) { #{{{
|
|||
"</p>");
|
||||
}
|
||||
else {
|
||||
if (defined pagetype($link)) {
|
||||
IkiWiki::redirect($cgi, $config{url}.IkiWiki::beautify_urlpath("/".htmlpage($link)));
|
||||
}
|
||||
else {
|
||||
IkiWiki::redirect($cgi, $config{url}.IkiWiki::beautify_urlpath("/".$link));
|
||||
}
|
||||
IkiWiki::redirect($cgi, urlto($link, undef, 1));
|
||||
}
|
||||
|
||||
exit;
|
||||
|
|
|
@ -210,7 +210,7 @@ sub sessioncgi ($$) { #{{{
|
|||
if (! exists $pagesources{$parent}) {
|
||||
$parent="index";
|
||||
}
|
||||
IkiWiki::redirect($q, $config{url}."/".htmlpage($parent));
|
||||
IkiWiki::redirect($q, urlto($parent, '/', 1));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue