From 200c599dcaeb4dde77564b84022b67bf71cd6bfa Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 22 Nov 2010 23:16:59 +0000 Subject: [PATCH] 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. --- IkiWiki.pm | 5 +++++ 1 file changed, 5 insertions(+) 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); } -- 2.39.5