diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-05 16:23:05 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-05 16:23:05 -0400 |
commit | 885bff723998525c10d7ea8ad295547f5fcc939a (patch) | |
tree | 459d99be5f042249b45e5f7eda33742da0db8c1d | |
parent | c91b39fdb52c935fbca20ca55a256278f4661a5b (diff) | |
download | ikiwiki-885bff723998525c10d7ea8ad295547f5fcc939a.tar ikiwiki-885bff723998525c10d7ea8ad295547f5fcc939a.tar.gz |
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.
-rw-r--r-- | IkiWiki.pm | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |