Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
2027e7dc
Commit
2027e7dc
authored
Sep 06, 2001
by
justdave%syndicomm.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
parent
8173dcf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
createattachment.cgi
createattachment.cgi
+4
-12
No files found.
createattachment.cgi
View file @
2027e7dc
...
...
@@ -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."
);
Punt
TryAgain
(
"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."
);
Punt
TryAgain
(
"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."
);
Punt
TryAgain
(
"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."
);
Punt
TryAgain
(
"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
)
.
", "
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment