summaryrefslogtreecommitdiffstats
path: root/createattachment.cgi
diff options
context:
space:
mode:
authorjustdave%syndicomm.com <>2001-09-06 12:20:34 +0200
committerjustdave%syndicomm.com <>2001-09-06 12:20:34 +0200
commit2027e7dcb9b953b80750b90f1e0edcf25406eeb9 (patch)
tree127a82d1195d83d45e2660e4d202cb22698a7b03 /createattachment.cgi
parent8173dcf5af3241159ea823d347e22996253cbad5 (diff)
downloadbugzilla-2027e7dcb9b953b80750b90f1e0edcf25406eeb9.tar.gz
bugzilla-2027e7dcb9b953b80750b90f1e0edcf25406eeb9.tar.xz
Fix for bug 42337: Adding the usual red box for errors uploading attachments.
Patch by Matthew Tuck <matty@chariot.net.au> r= louie@ximian.com, justdave@syndicomm.com
Diffstat (limited to 'createattachment.cgi')
-rwxr-xr-xcreateattachment.cgi16
1 files changed, 4 insertions, 12 deletions
diff --git a/createattachment.cgi b/createattachment.cgi
index 6af304bec..619abbd26 100755
--- a/createattachment.cgi
+++ b/createattachment.cgi
@@ -28,14 +28,6 @@ require "CGI.pl";
use vars %::COOKIE, %::FILENAME;
-sub Punt {
- my ($str) = (@_);
- print "$str<P>Please hit <b>Back</b> and try again.\n";
- PutFooter();
- exit;
-}
-
-
confirm_login();
print "Content-type: text/html\n\n";
@@ -73,16 +65,16 @@ What kind of file is this?
};
} else {
if ($::FORM{'data'} eq "" || !defined $::FILENAME{'data'}) {
- Punt("No file was provided, or it was empty.");
+ PuntTryAgain("No file was provided, or it was empty.");
}
my $desc = trim($::FORM{'description'});
if ($desc eq "") {
- Punt("You must provide a description of your attachment.");
+ PuntTryAgain("You must provide a description of your attachment.");
}
my $ispatch = 0;
my $mimetype = $::FORM{'type'};
if (!defined $mimetype) {
- Punt("You must select which kind of file you have.");
+ PuntTryAgain("You must select which kind of file you have.");
}
$mimetype = trim($mimetype);
if ($mimetype eq "patch") {
@@ -93,7 +85,7 @@ What kind of file is this?
$mimetype = $::FORM{'othertype'};
}
if ($mimetype !~ m@^(\w|-|\+|\.)+/(\w|-|\+|\.)+$@) {
- Punt("You must select a legal mime type. '<tt>$mimetype</tt>' simply will not do.");
+ PuntTryAgain("You must select a legal mime type. '<tt>$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) . ", " .