]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
use one-parameter form of urlto
authorJoey Hess <joey@kitenet.net>
Mon, 29 Nov 2010 19:07:26 +0000 (15:07 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 29 Nov 2010 19:07:26 +0000 (15:07 -0400)
IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/editpage.pm
IkiWiki/Plugin/goto.pm
IkiWiki/Plugin/img.pm
IkiWiki/Plugin/poll.pm
IkiWiki/Plugin/recentchanges.pm
IkiWiki/Plugin/remove.pm

index a3cb7c3d56c784f18251aaa34a14776d6f107962..68ac4cfae4844dd7de3b44e7af9956d00ab3ac75 100644 (file)
@@ -237,7 +237,7 @@ sub preprocess {
        }
 
        if ($params{page} =~ m/\/\Q$config{comments_pagename}\E\d+_/) {
-               $pagestate{$page}{meta}{permalink} = urlto(IkiWiki::dirname($params{page}), undef).
+               $pagestate{$page}{meta}{permalink} = urlto(IkiWiki::dirname($params{page})).
                        "#".page_to_id($params{page});
        }
 
@@ -372,7 +372,7 @@ sub editcomment ($$) {
                error(gettext("bad page name"));
        }
 
-       my $baseurl = urlto($page, undef);
+       my $baseurl = urlto($page);
 
        $form->title(sprintf(gettext("commenting on %s"),
                        IkiWiki::pagetitle($page)));
@@ -385,8 +385,7 @@ sub editcomment ($$) {
 
        if ($form->submitted eq CANCEL) {
                # bounce back to the page they wanted to comment on, and exit.
-               # CANCEL need not be considered in future
-               IkiWiki::redirect($cgi, urlto($page, undef));
+               IkiWiki::redirect($cgi, $baseurl);
                exit;
        }
 
@@ -552,7 +551,7 @@ sub editcomment ($$) {
                # Jump to the new comment on the page.
                # The trailing question mark tries to avoid broken
                # caches and get the most recent version of the page.
-               IkiWiki::redirect($cgi, urlto($page, undef).
+               IkiWiki::redirect($cgi, urlto($page).
                        "?updated#".page_to_id($location));
 
        }
@@ -811,14 +810,14 @@ sub pagetemplate (@) {
        if ($shown) {
                if ($template->query(name => 'commentsurl')) {
                        $template->param(commentsurl =>
-                               urlto($page, undef).'#comments');
+                               urlto($page).'#comments');
                }
 
                if ($template->query(name => 'atomcommentsurl') && $config{usedirs}) {
                        # This will 404 until there are some comments, but I
                        # think that's probably OK...
                        $template->param(atomcommentsurl =>
-                               urlto($page, undef).'comments.atom');
+                               urlto($page).'comments.atom');
                }
 
                if ($template->query(name => 'commentslink')) {
index b3ae1fded1d5792513ded7c8ce745bc4e6362fc2..da071d4920fe0e5fcafde8f20419925522278d31 100644 (file)
@@ -98,7 +98,7 @@ sub cgi_editpage ($$) {
                error(gettext("bad page name"));
        }
 
-       my $baseurl = urlto($page, undef);
+       my $baseurl = urlto($page);
 
        my $from;
        if (defined $form->field('from')) {
@@ -156,13 +156,13 @@ sub cgi_editpage ($$) {
        my $previewing=0;
        if ($form->submitted eq "Cancel") {
                if ($form->field("do") eq "create" && defined $from) {
-                       redirect($q, urlto($from, undef));
+                       redirect($q, urlto($from));
                }
                elsif ($form->field("do") eq "create") {
                        redirect($q, baseurl(undef));
                }
                else {
-                       redirect($q, urlto($page, undef));
+                       redirect($q, $baseurl);
                }
                exit;
        }
@@ -262,7 +262,7 @@ sub cgi_editpage ($$) {
                                        @page_locs=$page;
                                }
                                else {
-                                       redirect($q, urlto($page, undef));
+                                       redirect($q, $baseurl);
                                        exit;
                                }
                        }
@@ -434,7 +434,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, urlto($page, undef)."?updated");
+                       redirect($q, $baseurl."?updated");
                }
        }
 
index 7f31fa5ca87b4fd5f26a609ee7c909bb4d741701..0eb83fc208de611d05a016ff8fc63c2c6913f1c8 100644 (file)
@@ -64,7 +64,7 @@ sub cgi_goto ($;$) {
                )
        }
        else {
-               IkiWiki::redirect($q, urlto($link, undef));
+               IkiWiki::redirect($q, urlto($link));
        }
 
        exit;
index b554a3dfc94a6c6cdd380f8e3461e6b2ec648e6a..103f6b2b3510067f10a5eddf86f8e657ba96fe29 100644 (file)
@@ -152,8 +152,8 @@ sub preprocess (@) {
                $imgurl=urlto($imglink, $params{destpage});
        }
        else {
-               $fileurl=urlto($file, undef);
-               $imgurl=urlto($imglink, undef);
+               $fileurl=urlto($file);
+               $imgurl=urlto($imglink);
        }
 
        if (! exists $params{class}) {
index 27df104ab6b05da2208b7d2d7155f49946ab4845..2773486a6c69560fdd0a2236607b800dc88b15e6 100644 (file)
@@ -103,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));
+                       IkiWiki::redirect($cgi, urlto($page));
                        exit;
                }
 
@@ -153,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));
+                       -url => urlto($page));
                exit;
        }
 }
index de12bb2c68d0f32ab82f696012f693a4217b8019..6fccd16f6df6c72590863626042166abaca5f51c 100644 (file)
@@ -127,7 +127,7 @@ sub sessioncgi ($$) {
                exit 0;
        }
 
-       IkiWiki::redirect($q, urlto($config{recentchangespage}, undef));
+       IkiWiki::redirect($q, urlto($config{recentchangespage}));
        exit 0;
 }
 
index 336a781ed527ae65edca735f336396077ac009ef..bc481502a7dc8ecaa179e781d4a2c4dc3348d7b2 100644 (file)
@@ -240,7 +240,7 @@ sub sessioncgi ($$) {
                                if (! exists $pagesources{$parent}) {
                                        $parent="index";
                                }
-                               IkiWiki::redirect($q, urlto($parent, undef));
+                               IkiWiki::redirect($q, urlto($parent));
                        }
                }
                else {