Bug 60818 - make Bugzilla cope with MIME types with parameters. Patch by gerv, r=myk.

git-svn-id: svn://10.0.0.236/trunk@105718 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gerv%gerv.net
2001-10-18 21:28:06 +00:00
parent 76596e112b
commit 9090a5fafb
2 changed files with 4 additions and 2 deletions

View File

@@ -299,6 +299,7 @@ if (Param('useattachmenttracker')) {
}
my $link = "showattachment.cgi?attach_id=$attachid";
$desc = value_quote($desc);
$mimetype = html_quote($mimetype);
print qq{<td><a href="$link">$date</a></td><td colspan=6>$desc&nbsp;&nbsp;&nbsp;($mimetype)</td></tr><tr><td></td>};
}
print "<td colspan=7><a href=\"createattachment.cgi?id=$id\">Create a new attachment</a> (proposed patch, testcase, etc.)</td></tr></table>\n";

View File

@@ -84,8 +84,9 @@ What kind of file is this?
if ($mimetype eq "other") {
$mimetype = $::FORM{'othertype'};
}
if ($mimetype !~ m@^(\w|-|\+|\.)+/(\w|-|\+|\.)+$@) {
PuntTryAgain("You must select a legal mime type. '<tt>$mimetype</tt>' simply will not do.");
if ($mimetype !~ m@^(\w|-|\+|\.)+/(\w|-|\+|\.)+(;.*)?$@) {
PuntTryAgain("You must select a legal mime type. '<tt>" .
html_quote($mimetype) . "</tt>' simply will not do.");
}
SendSQL("insert into attachments (bug_id, filename, description, mimetype, ispatch, submitter_id, thedata) values ($id," .
SqlQuote($::FILENAME{'data'}) . ", " . SqlQuote($desc) . ", " .