]> 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:55:29 +0000 (22:55 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 14 Feb 2011 21:55:29 +0000 (22:55 +0100)
r=mkanat a=LpSolit

Bugzilla/User.pm
buglist.cgi

index 30c4e629318bbff01c0858ce30546edb824bcca3..f81ed2b2f2643006af048958beb8dddfb5f48748 100644 (file)
@@ -423,7 +423,8 @@ sub recent_search_for {
     # and the selected bug is in the list, then return the cookie as a fake
     # Search::Recent object.
     if (my $list = $cgi->cookie('BUGLIST')) {
-        my @bug_ids = split(':', $list);
+        # Also split on colons, which was used as a separator in old cookies.
+        my @bug_ids = split(/[:-]/, $list);
         if (grep { $_ == $bug->id } @bug_ids) {
             my $search = Bugzilla::Search::Recent->new_from_cookie(\@bug_ids);
             return $search;
@@ -494,7 +495,7 @@ sub save_last_search {
     # they may still want to navigate through the search they made while
     # logged out.
     else {
-        my $bug_list = join(":", @$bug_ids);
+        my $bug_list = join('-', @$bug_ids);
         if (length($bug_list) < 4000) {
             $cgi->send_cookie(-name => 'BUGLIST',
                               -value => $bug_list,
index 788f28c956eb4362f799a4b0333c426a86eb0f14..ba80bb0359abe3580a827bcf43e3d07ae1145cd1 100755 (executable)
@@ -184,7 +184,7 @@ if (my $last_list = $cgi->param('regetlastlist')) {
         $cgi->cookie('BUGLIST') || ThrowUserError("missing_cookie");
         $order = "reuse last sort" unless $order;
         $bug_ids = $cgi->cookie('BUGLIST');
-        $bug_ids =~ s/:/,/g;
+        $bug_ids =~ s/[:-]/,/g;
     }
     # But logged in users store the last X searches in the DB so they can
     # have multiple bug lists available.