]> git.donarmstrong.com Git - debbugs.git/commitdiff
fix munge_uri function to handle deleting params correctly
authorDon Armstrong <don@donarmstrong.com>
Sun, 17 Jun 2007 23:31:07 +0000 (00:31 +0100)
committerDon Armstrong <don@donarmstrong.com>
Sun, 17 Jun 2007 23:31:07 +0000 (00:31 +0100)
Debbugs/CGI.pm

index 66637c091d9555689c66410ecea59e4234168cd6..3d1f2c4f1106f48d90a0223cf9fc2f0c1c07945c 100644 (file)
@@ -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;
 }