diff options
author | intrigeri <intrigeri@boum.org> | 2010-12-20 14:36:21 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2010-12-20 14:36:21 +0100 |
commit | 74055be78f46fd4997eee160a092fd7e117b6c45 (patch) | |
tree | ea91683641fb22a34a56ba80acbf6db120fffff8 /IkiWiki/Plugin | |
parent | 75196e76b627709a6ecae3fa948e1fba7928a5ce (diff) | |
download | ikiwiki-74055be78f46fd4997eee160a092fd7e117b6c45.tar ikiwiki-74055be78f46fd4997eee160a092fd7e117b6c45.tar.gz |
po plugin: update injected urlto signature.
The lack of $from will probably hurt setups using po_link_to = current,
but at least we can fix the blocker bug that prevents any wiki using the po
plugin to build.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/po.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 79142ed1f..a142bb909 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -635,7 +635,7 @@ sub mytargetpage ($$) { return $origsubs{'targetpage'}->($page, $ext); } -sub myurlto ($$;$) { +sub myurlto ($;$$) { my $to=shift; my $from=shift; my $absolute=shift; @@ -644,7 +644,12 @@ sub myurlto ($$;$) { if (! length $to && $config{po_link_to} eq "current" && istranslatable('index')) { - return IkiWiki::beautify_urlpath(IkiWiki::baseurl($from) . "index." . lang($from) . ".$config{htmlext}"); + if (defined $from) { + return IkiWiki::beautify_urlpath(IkiWiki::baseurl($from) . "index." . lang($from) . ".$config{htmlext}"); + } + else { + return $origsubs{'urlto'}->($to,$from,$absolute); + } } # avoid using our injected beautify_urlpath if run by cgi_editpage, # so that one is redirected to the just-edited page rather than to the |