From: Joey Hess Date: Wed, 5 Jan 2011 20:23:05 +0000 (-0400) Subject: make urlabs a noop if base url is not provided X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=885bff723998525c10d7ea8ad295547f5fcc939a;p=ikiwiki.git make urlabs a noop if base url is not provided This allows urlabs($foo, $config{url}) to be used safely, even if no url is configured. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index ef8ccb2da..35e64d815 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1072,6 +1072,8 @@ sub urlabs ($$) { my $url=shift; my $urlbase=shift; + return $url unless defined $urlbase && length $urlbase; + eval q{use URI}; URI->new_abs($url, $urlbase)->as_string; }