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.
master
Simon McVittie 2010-11-22 23:16:59 +00:00
parent 8f64c69e08
commit 200c599dca
1 changed files with 5 additions and 0 deletions

View File

@ -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);
}