summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2010-11-22 23:16:59 +0000
committerSimon McVittie <smcv@debian.org>2010-11-22 23:16:59 +0000
commit200c599dcaeb4dde77564b84022b67bf71cd6bfa (patch)
tree17c95828754913684c528f965395a9061cc5f02e
parent8f64c69e084c698a389565203bd18bccb33f5d69 (diff)
cgiurl: don't append "?" if there are no parameters
This means we can use cgiurl() instead of $config{cgiurl} if an absolute URL isn't desired.
-rw-r--r--IkiWiki.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 1d37e7f8e..989f3bee7 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1044,6 +1044,11 @@ sub cgiurl (@) {
$cgiurl=$params{cgiurl};
delete $params{cgiurl};
}
+
+ unless (%params) {
+ return $cgiurl;
+ }
+
return $cgiurl."?".
join("&amp;", map $_."=".uri_escape_utf8($params{$_}), keys %params);
}