projects
/
ikiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c91b39f
)
make urlabs a noop if base url is not provided
author
Joey Hess
<joey@kitenet.net>
Wed, 5 Jan 2011 20:23:05 +0000
(16:23 -0400)
committer
Joey Hess
<joey@kitenet.net>
Wed, 5 Jan 2011 20:23:05 +0000
(16:23 -0400)
This allows urlabs($foo, $config{url}) to be used safely, even if
no url is configured.
IkiWiki.pm
patch
|
blob
|
history
diff --git
a/IkiWiki.pm
b/IkiWiki.pm
index ef8ccb2da51e4b763418344237280cf563011fba..35e64d81568f6c98aedf18af682c77836310fc8b 100644
(file)
--- 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;
}