aboutsummaryrefslogtreecommitdiffstats
path: root/createattachment.cgi
diff options
context:
space:
mode:
authorgerv%gerv.net <>2001-10-19 04:28:06 +0000
committergerv%gerv.net <>2001-10-19 04:28:06 +0000
commit0514605a98956216ded50969c26b2d78dcf2e260 (patch)
tree5d45eb59bac7d14cca94968f43272168048f14a1 /createattachment.cgi
parent858fd64e0faa9a0717167f1d84543c4a542c495c (diff)
downloadbugs-0514605a98956216ded50969c26b2d78dcf2e260.tar
bugs-0514605a98956216ded50969c26b2d78dcf2e260.tar.gz
bugs-0514605a98956216ded50969c26b2d78dcf2e260.tar.bz2
bugs-0514605a98956216ded50969c26b2d78dcf2e260.tar.xz
bugs-0514605a98956216ded50969c26b2d78dcf2e260.zip
Bug 60818 - make Bugzilla cope with MIME types with parameters. Patch by gerv, r=myk.
Diffstat (limited to 'createattachment.cgi')
-rwxr-xr-xcreateattachment.cgi5
1 files changed, 3 insertions, 2 deletions
diff --git a/createattachment.cgi b/createattachment.cgi
index 619abbd26..d665e4498 100755
--- a/createattachment.cgi
+++ b/createattachment.cgi
@@ -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) . ", " .