aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-01-05 16:23:05 -0400
committerJoey Hess <joey@kitenet.net>2011-01-05 16:23:05 -0400
commit885bff723998525c10d7ea8ad295547f5fcc939a (patch)
tree459d99be5f042249b45e5f7eda33742da0db8c1d
parentc91b39fdb52c935fbca20ca55a256278f4661a5b (diff)
downloadikiwiki-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.pm2
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;
}