Commit 94aa1c35 authored by kiko%async.com.br's avatar kiko%async.com.br

Fix for bug 238864: remove %FORM and %COOKIE from move.pl; does just

that (incorporating a recommendation from justdave). r=justdave, a=justdave.
parent 951d8c39
...@@ -28,7 +28,7 @@ use lib qw(.); ...@@ -28,7 +28,7 @@ use lib qw(.);
require "CGI.pl"; require "CGI.pl";
use vars qw($template $userid %COOKIE); use vars qw($template $userid);
use Bugzilla; use Bugzilla;
use Bugzilla::Constants; use Bugzilla::Constants;
...@@ -79,7 +79,7 @@ sub Unlock { ...@@ -79,7 +79,7 @@ sub Unlock {
} }
} }
if ( !defined $::FORM{'buglist'} ) { if (!defined $cgi->param('buglist')) {
print $cgi->header(); print $cgi->header();
PutHeader("Move Bugs"); PutHeader("Move Bugs");
print "Move bugs either from the bug display page or perform a "; print "Move bugs either from the bug display page or perform a ";
...@@ -90,7 +90,7 @@ if ( !defined $::FORM{'buglist'} ) { ...@@ -90,7 +90,7 @@ if ( !defined $::FORM{'buglist'} ) {
exit; exit;
} }
my $exporter = $::COOKIE{"Bugzilla_login"}; my $exporter = Bugzilla->user->login;
my $movers = Param("movers"); my $movers = Param("movers");
$movers =~ s/\s?,\s?/|/g; $movers =~ s/\s?,\s?/|/g;
$movers =~ s/@/\@/g; $movers =~ s/@/\@/g;
...@@ -105,7 +105,7 @@ unless ($exporter =~ /($movers)/) { ...@@ -105,7 +105,7 @@ unless ($exporter =~ /($movers)/) {
my @bugs; my @bugs;
print "<P>\n"; print "<P>\n";
foreach my $id (split(/:/, $::FORM{'buglist'})) { foreach my $id (split(/:/, scalar($cgi->param('buglist')))) {
my $bug = new Bugzilla::Bug($id, $::userid); my $bug = new Bugzilla::Bug($id, $::userid);
push @bugs, $bug; push @bugs, $bug;
if (!$bug->error) { if (!$bug->error) {
...@@ -126,8 +126,8 @@ foreach my $id (split(/:/, $::FORM{'buglist'})) { ...@@ -126,8 +126,8 @@ foreach my $id (split(/:/, $::FORM{'buglist'})) {
SendSQL("UPDATE bugs SET resolution =\"MOVED\" where bug_id=\"$id\""); SendSQL("UPDATE bugs SET resolution =\"MOVED\" where bug_id=\"$id\"");
my $comment = ""; my $comment = "";
if (defined $::FORM{'comment'} && $::FORM{'comment'} !~ /^\s*$/) { if (defined $cgi->param('comment') && $cgi->param('comment') !~ /^\s*$/) {
$comment .= $::FORM{'comment'} . "\n\n"; $comment .= $cgi->param('comment') . "\n\n";
} }
$comment .= "Bug moved to " . Param("move-to-url") . ".\n\n"; $comment .= "Bug moved to " . Param("move-to-url") . ".\n\n";
$comment .= "If the move succeeded, $exporter will receive a mail\n"; $comment .= "If the move succeeded, $exporter will receive a mail\n";
...@@ -143,7 +143,7 @@ foreach my $id (split(/:/, $::FORM{'buglist'})) { ...@@ -143,7 +143,7 @@ foreach my $id (split(/:/, $::FORM{'buglist'})) {
} }
print "<P>\n"; print "<P>\n";
my $buglist = $::FORM{'buglist'}; my $buglist = $cgi->param('buglist');
$buglist =~ s/:/,/g; $buglist =~ s/:/,/g;
my $host = Param("urlbase"); my $host = Param("urlbase");
$host =~ s#http://([^/]+)/.*#$1#; $host =~ s#http://([^/]+)/.*#$1#;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment