Commit 37dc5c77 authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 170986 - General Summary reports don't work with taint checking. Also fixes…

Bug 170986 - General Summary reports don't work with taint checking. Also fixes Throw*Error's $extra_vars parameter. Patch by gerv; r=bbaetz.
parent ca452282
...@@ -854,7 +854,9 @@ sub ThrowCodeError { ...@@ -854,7 +854,9 @@ sub ThrowCodeError {
SendSQL("UNLOCK TABLES") if $unlock_tables; SendSQL("UNLOCK TABLES") if $unlock_tables;
# Copy the extra_vars into the vars hash # Copy the extra_vars into the vars hash
@::vars{keys %$extra_vars} = values %$extra_vars; foreach my $var (keys %$extra_vars) {
$vars->{$var} = $extra_vars->{$var};
}
# We may one day log something to file here also. # We may one day log something to file here also.
$vars->{'variables'} = $extra_vars; $vars->{'variables'} = $extra_vars;
...@@ -873,7 +875,9 @@ sub ThrowUserError { ...@@ -873,7 +875,9 @@ sub ThrowUserError {
SendSQL("UNLOCK TABLES") if $unlock_tables; SendSQL("UNLOCK TABLES") if $unlock_tables;
# Copy the extra_vars into the vars hash # Copy the extra_vars into the vars hash
@::vars{keys %$extra_vars} = values %$extra_vars; foreach my $var (keys %$extra_vars) {
$vars->{$var} = $extra_vars->{$var};
}
print "Content-type: text/html\n\n" if !$vars->{'header_done'}; print "Content-type: text/html\n\n" if !$vars->{'header_done'};
$template->process("global/user-error.html.tmpl", $vars) $template->process("global/user-error.html.tmpl", $vars)
......
...@@ -1637,6 +1637,8 @@ sub GetFormat { ...@@ -1637,6 +1637,8 @@ sub GetFormat {
# Security - allow letters and a hyphen only # Security - allow letters and a hyphen only
$ctype =~ s/[^a-zA-Z\-]//g; $ctype =~ s/[^a-zA-Z\-]//g;
$format =~ s/[^a-zA-Z\-]//g; $format =~ s/[^a-zA-Z\-]//g;
trick_taint($ctype);
trick_taint($format);
$template .= ($format ? "-$format" : ""); $template .= ($format ? "-$format" : "");
$template .= ".$ctype.tmpl"; $template .= ".$ctype.tmpl";
......
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