]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 480044: Use dashes instead of colons to separate bug IDs in the BUGLIST cookie...
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 14 Feb 2011 21:56:52 +0000 (22:56 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 14 Feb 2011 21:56:52 +0000 (22:56 +0100)
r=mkanat a=LpSolit

Bugzilla/Template.pm
buglist.cgi
process_bug.cgi

index 912646f839da738463f2a9b2b3a1b74ac77fc34f..f3fc1b82d35c53648464cdd93b8c1f85a7f45c35 100644 (file)
@@ -767,7 +767,9 @@ sub create {
                 my @bug_list;
                 my $cgi = Bugzilla->cgi;
                 if ($cgi->cookie("BUGLIST")) {
-                    @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
+                    # Also split on colons, which was used as a separator
+                    # in old cookies.
+                    @bug_list = split(/[:-]/, $cgi->cookie("BUGLIST"));
                 }
                 return \@bug_list;
             },
index 1d5f1761290332ec1673470c3d268badac3ced82..c12e211f317f7209a8899099d5fff21bc24e37b4 100755 (executable)
@@ -190,7 +190,7 @@ if (defined $cgi->param('regetlastlist')) {
 
     $order = "reuse last sort" unless $order;
     my $bug_id = $cgi->cookie('BUGLIST');
-    $bug_id =~ s/:/,/g;
+    $bug_id =~ s/[:-]/,/g;
     # set up the params for this new query
     $params = new Bugzilla::CGI({
                                  bug_id => $bug_id,
@@ -1209,7 +1209,7 @@ if ($format->{'extension'} eq "html" && !$agent) {
                           -value => $order,
                           -expires => 'Fri, 01-Jan-2038 00:00:00 GMT');
     }
-    my $bugids = join(":", @bugidlist);
+    my $bugids = join('-', @bugidlist);
     # See also Bug 111999
     if (length($bugids) == 0) {
         $cgi->remove_cookie('BUGLIST');
index 32f8e4a066bca0faa79218d89e86c269899c9bf2..9be1cdf6d2cb8d090887fd47641ff3390895d4af 100755 (executable)
@@ -206,7 +206,8 @@ if (defined $cgi->param('id')) {
     if ($action eq 'next_bug') {
         my @bug_list;
         if ($cgi->cookie("BUGLIST")) {
-            @bug_list = split(/:/, $cgi->cookie("BUGLIST"));
+            # Also split on colons, which was used as a separator in old cookies.
+            @bug_list = split(/[:-]/, $cgi->cookie("BUGLIST"));
         }
         my $cur = lsearch(\@bug_list, $cgi->param('id'));
         if ($cur >= 0 && $cur < $#bug_list) {