Bug 150802 - default version for bug entry not read from cookies

r=jouni x2
This commit is contained in:
bbaetz%student.usyd.edu.au 2002-06-11 13:32:01 +00:00
Родитель 8226cfb52e
Коммит 51d1fc0692
2 изменённых файлов: 8 добавлений и 5 удалений

Просмотреть файл

@ -300,10 +300,16 @@ $default{'rep_platform'} = pickplatform();
$vars->{'op_sys'} = \@legal_opsys; $vars->{'op_sys'} = \@legal_opsys;
$default{'op_sys'} = pickos(); $default{'op_sys'} = pickos();
# Default version is the last one in the list (hopefully the latest one). # Posting a bug sets a cookie for the current version, if one exists. Else,
# the default version is the last one in the list (hopefully the latest one).
# Eventually maybe each product should have a "current version" parameter. # Eventually maybe each product should have a "current version" parameter.
$vars->{'version'} = $::versions{$product} || []; $vars->{'version'} = $::versions{$product} || [];
$default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}]; if (exists $::COOKIE{"VERSION-$product"} &&
lsearch($vars->{'version'}, $::COOKIE{"VERSION-$product"}) != -1) {
$default{'version'} = $::COOKIE{"VERSION-$product"};
} else {
$default{'version'} = $vars->{'version'}->[$#{$vars->{'version'}}];
}
# There must be at least one status in @status. # There must be at least one status in @status.
my @status = "NEW"; my @status = "NEW";

Просмотреть файл

@ -73,9 +73,6 @@ my $product = $::FORM{'product'};
# Set cookies # Set cookies
my $cookiepath = Param("cookiepath"); my $cookiepath = Param("cookiepath");
if (exists $::FORM{'product'}) { if (exists $::FORM{'product'}) {
print "Set-Cookie: PLATFORM=$product ; path=$cookiepath ; \
expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
if (exists $::FORM{'version'}) { if (exists $::FORM{'version'}) {
print "Set-Cookie: VERSION-$product=$::FORM{'version'} ; \ print "Set-Cookie: VERSION-$product=$::FORM{'version'} ; \
path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n"; path=$cookiepath ; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";