]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
cgiurl: don't append "?" if there are no parameters
authorSimon McVittie <smcv@debian.org>
Mon, 22 Nov 2010 23:16:59 +0000 (23:16 +0000)
committerSimon McVittie <smcv@debian.org>
Mon, 22 Nov 2010 23:16:59 +0000 (23:16 +0000)
This means we can use cgiurl() instead of $config{cgiurl} if an absolute
URL isn't desired.

IkiWiki.pm

index 1d37e7f8eec96551254c3b86d101092b71e8609b..989f3bee7ca47b427f8ba68806db3c80a0117589 100644 (file)
@@ -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);
 }