From: Don Armstrong Date: Sun, 17 Jun 2007 23:31:07 +0000 (+0100) Subject: fix munge_uri function to handle deleting params correctly X-Git-Tag: release/2.6.0~546^2~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1ca87be51f7bc4e4fcd73b57ec2e68fac4f05053;p=debbugs.git fix munge_uri function to handle deleting params correctly --- diff --git a/Debbugs/CGI.pm b/Debbugs/CGI.pm index 66637c0..3d1f2c4 100644 --- a/Debbugs/CGI.pm +++ b/Debbugs/CGI.pm @@ -139,8 +139,12 @@ sub munge_url { my $url = shift; my %params = @_; my $new_url = Debbugs::URI->new($url); - %params = ($new_url->query_form(),%params); - $new_url->query_form(%params); + my @old_param = $new_url->query_form(); + my @new_param; + while (my ($key,$value) = splice @old_param,0,2) { + push @new_param,($key,$value) unless exists $params{$key}; + } + $new_url->query_form(@new_param,%params); return $new_url->as_string; }