]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 60818 - make Bugzilla cope with MIME types with parameters. Patch by gerv, r...
authorgerv%gerv.net <>
Fri, 19 Oct 2001 04:28:06 +0000 (04:28 +0000)
committergerv%gerv.net <>
Fri, 19 Oct 2001 04:28:06 +0000 (04:28 +0000)
bug_form.pl
createattachment.cgi

index 5938f3aeaed4a8c5cbd5b423ea5dafce1c5d73e3..d3311fee5bdfc161876f8e2ba11acf95515e2118 100644 (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";
index 619abbd262fdab8317bd90e72dc48c4349faf104..d665e4498e16b958bca8e54297c09f9ed4d3a2b6 100755 (executable)
@@ -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) . ", " .