sub DumpBugActivity {
my ($id, $starttime) = (@_);
my $datepart = "";
+
+ die "Invalid id: $id" unless $id=~/^\s*\d+\s*$/;
+
if (defined $starttime) {
$datepart = "and bugs_activity.bug_when >= $starttime";
}
}
if (defined $F{'sql'}) {
+ die "Invalid sql: $F{'sql'}" if $F{'sql'} =~ /;/;
push(@wherepart, "( $F{'sql'} )");
}
$::FORM{'order'} =~ s/assign\.login_name/map_assigned_to.login_name/g;
# Another backwards compatability hack.
+ die "Invalid order: $::FORM{'order'}" unless
+ $::FORM{'order'} =~ /^([a-zA-Z0-9_., ]+)$/;
ORDER: for ($::FORM{'order'}) {
/\./ && do {
# This (hopefully) already has fieldnames in it, so we're done.
print "Content-type: text/html\n\n";
my $id = $::FORM{'id'};
+die "invalid id: $id" unless $id=~/^\s*\d+\s*$/;
PutHeader("Create an attachment", "Create attachment", "Bug $id");
FIN
if( $::FORM{'product'} ne "-All-" ) {
- $query .= "and bugs.product='$::FORM{'product'}'";
+ $query .= "and bugs.product=".SqlQuote($::FORM{'product'});
}
$query .= <<FIN;
my $query;
$query = "select distinct assigned_to from bugs where target_milestone=\"$ms\"";
if( $::FORM{'product'} ne "-All-" ) {
- $query .= "and bugs.product='$::FORM{'product'}'";
+ $query .= "and bugs.product=".SqlQuote($::FORM{'product'});
}
$query .= <<FIN;
and
{
my $query = "select count(bug_id) from bugs,profiles where target_milestone=\"$ms\" and userid=assigned_to and userid=\"$person\"";
if( $::FORM{'product'} ne "-All-" ) {
- $query .= "and bugs.product='$::FORM{'product'}'";
+ $query .= "and bugs.product=".SqlQuote($::FORM{'product'})";
}
$query .= <<FIN;
and
my $query;
$query = "select distinct assigned_to from bugs where bugs.bug_status='NEW' and target_milestone='' and bug_severity!='enhancement' and status_whiteboard='' and (product='Browser' or product='MailNews')";
if( $::FORM{'product'} ne "-All-" ) {
- $query .= "and bugs.product='$::FORM{'product'}'";
+ $query .= "and bugs.product=".SqlQuote($::FORM{'product'});
}
# End build up $query string
my @row;
if (defined $::FORM{'attach_id'}) {
- SendSQL("select mimetype, thedata from attachments where attach_id = $::FORM{'attach_id'}");
+ SendSQL("select mimetype, thedata from attachments where attach_id =".SqlQuote($::FORM{'attach_id'});
@row = FetchSQLData();
}
if (!@row) {
require "CGI.pl";
my $id = $::FORM{'id'};
+die "Invalid id: $id" unless $id =~ /^\s*\d+\s*$/;
my $urlbase = Param("urlbase");
my %seen;