]> sipb.mit.edu Git - ikiwiki.git/commitdiff
avoid uninitlized value when urlto is called with 1 parameter and no url is configured
authorJoey Hess <joey@kitenet.net>
Sun, 27 Feb 2011 22:32:44 +0000 (18:32 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 27 Feb 2011 22:32:44 +0000 (18:32 -0400)
This brings back the old behavior before urlto changes for this case.
It will generate a path like "/foo", which is not right, but is
the same as is generated by urlto($page, "", 1) -- which is what
the code that now uses 1-parameter urlto used to use.

IkiWiki.pm

index 7d1f5c401f3daf6f6eeb7726a46e2f36fa1a7356..9de25a4b31dc46dd450b2a6ab60261f44e9f0401 100644 (file)
@@ -1168,7 +1168,7 @@ sub urlto ($;$$) {
        }
 
        if (! defined $from) {
-               my $u = $local_url;
+               my $u = $local_url || '';
                $u =~ s{/$}{};
                return $u.beautify_urlpath("/".$to);
        }