diff options
author | Simon McVittie <smcv@debian.org> | 2010-11-22 23:16:59 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2010-11-22 23:16:59 +0000 |
commit | 200c599dcaeb4dde77564b84022b67bf71cd6bfa (patch) | |
tree | 17c95828754913684c528f965395a9061cc5f02e | |
parent | 8f64c69e084c698a389565203bd18bccb33f5d69 (diff) | |
download | ikiwiki-200c599dcaeb4dde77564b84022b67bf71cd6bfa.tar ikiwiki-200c599dcaeb4dde77564b84022b67bf71cd6bfa.tar.gz |
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.pm | 5 |
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("&", map $_."=".uri_escape_utf8($params{$_}), keys %params); } |