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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
8f6ab920
Commit
8f6ab920
authored
Nov 09, 2001
by
myk%mozilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug 109048: fixes error when creating attachments without logging in.
Patch by Myk Melez <myk@mozilla.org>. r=bbaetz,gerv
parent
5e6e016a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
attachment.cgi
attachment.cgi
+4
-3
No files found.
attachment.cgi
View file @
8f6ab920
...
...
@@ -91,11 +91,13 @@ elsif ($action eq "viewall")
}
elsif
(
$action
eq
"enter"
)
{
confirm_login
();
ValidateBugID
(
$::FORM
{
'bugid'
});
enter
();
}
elsif
(
$action
eq
"insert"
)
{
confirm_login
();
ValidateBugID
(
$::FORM
{
'bugid'
});
validateFilename
();
validateData
();
...
...
@@ -472,12 +474,11 @@ sub insert
my
$filename
=
SqlQuote
(
$::FILE
{
'data'
}
->
{
'filename'
});
my
$description
=
SqlQuote
(
$::FORM
{
'description'
});
my
$contenttype
=
SqlQuote
(
$::FORM
{
'contenttype'
});
my
$submitterid
=
DBNameToIdAndCheck
(
$::COOKIE
{
'Bugzilla_login'
});
my
$thedata
=
SqlQuote
(
$::FORM
{
'data'
});
# Insert the attachment into the database.
SendSQL
(
"INSERT INTO attachments (bug_id, filename, description, mimetype, ispatch, submitter_id, thedata)
VALUES ($::FORM{'bugid'}, $filename, $description, $contenttype, $::FORM{'ispatch'}, $
submitt
erid, $thedata)"
);
VALUES ($::FORM{'bugid'}, $filename, $description, $contenttype, $::FORM{'ispatch'}, $
::us
erid, $thedata)"
);
# Retrieve the ID of the newly created attachment record.
SendSQL
(
"SELECT LAST_INSERT_ID()"
);
...
...
@@ -501,7 +502,7 @@ sub insert
foreach
my
$attachid
(
@
{
$::MFORM
{
'obsolete'
}})
{
SendSQL
(
"UPDATE attachments SET isobsolete = 1 WHERE attach_id = $attachid"
);
SendSQL
(
"INSERT INTO bugs_activity (bug_id, attach_id, who, bug_when, fieldid, removed, added)
VALUES ($::FORM{'bugid'}, $attachid, $
submitt
erid, NOW(), $fieldid, '0', '1')"
);
VALUES ($::FORM{'bugid'}, $attachid, $
::us
erid, NOW(), $fieldid, '0', '1')"
);
}
# Send mail to let people know the attachment has been created. Uses a
...
...
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