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
2b77f746
Commit
2b77f746
authored
Oct 31, 2001
by
myk%mozilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug 98602: re-implementation of "create attachment" page.
Patch by Myk Melez <myk@mozilla.org>. r=gerv@mozilla.org,jake@acutex.net
parent
5fd4cf43
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
38 deletions
+73
-38
Attachment.pm
Attachment.pm
+1
-4
Attachment.pm
Bugzilla/Attachment.pm
+1
-4
CGI.pl
CGI.pl
+46
-30
attachment.cgi
attachment.cgi
+0
-0
checksetup.pl
checksetup.pl
+1
-0
defparams.pl
defparams.pl
+24
-0
No files found.
Attachment.pm
View file @
2b77f746
...
...
@@ -72,16 +72,13 @@ sub list
my
@attachments
=
();
while
(
&::
MoreSQLData
())
{
my
%
a
;
(
$a
{
'attachid'
},
$a
{
'date'
},
$a
{
'
mime
type'
},
$a
{
'description'
},
$a
{
'ispatch'
},
$a
{
'isobsolete'
})
=
&::
FetchSQLData
();
(
$a
{
'attachid'
},
$a
{
'date'
},
$a
{
'
content
type'
},
$a
{
'description'
},
$a
{
'ispatch'
},
$a
{
'isobsolete'
})
=
&::
FetchSQLData
();
# Format the attachment's creation/modification date into something readable.
if
(
$a
{
'date'
}
=~
/^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/
)
{
$a
{
'date'
}
=
"$3/$4/$2 $5:$6"
;
}
# Quote HTML characters (&<>) in the description so they display correctly.
$a
{
'description'
}
=
&::
value_quote
(
$a
{
'description'
});
# Retrieve a list of status flags that have been set on the attachment.
&::
PushGlobalSQLState
();
&::
SendSQL
(
"
...
...
Bugzilla/Attachment.pm
View file @
2b77f746
...
...
@@ -72,16 +72,13 @@ sub list
my
@attachments
=
();
while
(
&::
MoreSQLData
())
{
my
%
a
;
(
$a
{
'attachid'
},
$a
{
'date'
},
$a
{
'
mime
type'
},
$a
{
'description'
},
$a
{
'ispatch'
},
$a
{
'isobsolete'
})
=
&::
FetchSQLData
();
(
$a
{
'attachid'
},
$a
{
'date'
},
$a
{
'
content
type'
},
$a
{
'description'
},
$a
{
'ispatch'
},
$a
{
'isobsolete'
})
=
&::
FetchSQLData
();
# Format the attachment's creation/modification date into something readable.
if
(
$a
{
'date'
}
=~
/^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/
)
{
$a
{
'date'
}
=
"$3/$4/$2 $5:$6"
;
}
# Quote HTML characters (&<>) in the description so they display correctly.
$a
{
'description'
}
=
&::
value_quote
(
$a
{
'description'
});
# Retrieve a list of status flags that have been set on the attachment.
&::
PushGlobalSQLState
();
&::
SendSQL
(
"
...
...
CGI.pl
View file @
2b77f746
...
...
@@ -42,7 +42,6 @@ use strict;
sub
CGI_pl_sillyness
{
my
$zz
;
$zz
=
%::
FILENAME
;
$zz
=
%::
MFORM
;
$zz
=
%::
dontchange
;
}
...
...
@@ -148,46 +147,63 @@ sub ProcessFormFields {
sub
ProcessMultipartFormFields
{
my
(
$boundary
)
=
(
@_
);
$boundary
=~
s/^-*//
;
my
$remaining
=
$ENV
{
"CONTENT_LENGTH"
};
my
(
$boundary
)
=
@_
;
# Initialize variables that store whether or not we are parsing a header,
# the name of the part we are parsing, and its value (which is incomplete
# until we finish parsing the part).
my
$inheader
=
1
;
my
$itemname
=
""
;
# open(DEBUG, ">debug") || die "Can't open debugging thing";
# print DEBUG "Boundary is '$boundary'\n";
my
$fieldname
=
""
;
my
$fieldvalue
=
""
;
# Read the input stream line by line and parse it into a series of parts,
# each one containing a single form field and its value and each one
# separated from the next by the value of $boundary.
my
$remaining
=
$ENV
{
"CONTENT_LENGTH"
};
while
(
$remaining
>
0
&&
(
$_
=
<
STDIN
>
))
{
$remaining
-=
length
(
$_
);
# print DEBUG "< $_";
# If the current input line is a boundary line, save the previous
# form value and reset the storage variables.
if
(
$_
=~
m/^-*$boundary/
)
{
# print DEBUG "Entered header\n";
$inheader
=
1
;
$itemname
=
""
;
next
;
}
if
(
$fieldname
)
{
chomp
(
$fieldvalue
);
$fieldvalue
=~
s/\r$//
;
if
(
defined
$::FORM
{
$fieldname
}
)
{
$::FORM
{
$fieldname
}
.=
$fieldvalue
;
push
@
{
$::MFORM
{
$fieldname
}},
$fieldvalue
;
}
else
{
$::FORM
{
$fieldname
}
=
$fieldvalue
;
$::MFORM
{
$fieldname
}
=
[
$fieldvalue
];
}
}
if
(
$inheader
)
{
$inheader
=
1
;
$fieldname
=
""
;
$fieldvalue
=
""
;
# If the current input line is a header line, look for a blank line
# (meaning the end of the headers), a Content-Disposition header
# (containing the field name and, for uploaded file parts, the file
# name), or a Content-Type header (containing the content type for
# file parts).
}
elsif
(
$inheader
)
{
if
(
m/^\s*$/
)
{
$inheader
=
0
;
# print DEBUG "left header\n";
$::FORM
{
$itemname
}
=
""
;
}
if
(
m/^Content-Disposition:\s*form-data\s*;\s*name\s*=\s*"([^\"]+)"/i
)
{
$itemname
=
$1
;
# print DEBUG "Found itemname $itemname\n";
}
elsif
(
m/^Content-Disposition:\s*form-data\s*;\s*name\s*=\s*"([^\"]+)"/i
)
{
$fieldname
=
$1
;
if
(
m/;\s*filename\s*=\s*"([^\"]+)"/i
)
{
$::FILE
NAME
{
$itemname
}
=
$1
;
$::FILE
{
$fieldname
}
->
{
'filename'
}
=
$1
;
}
}
elsif
(
m
|^
Content
-
Type:
\
s
*
([
^
/]+/
[
^\
s
;]
+
)
|
i
)
{
$::FILE
{
$fieldname
}
->
{
'contenttype'
}
=
$1
;
}
next
;
# If the current input line is neither a boundary line nor a header,
# it must be part of the field value, so append it to the value.
}
else
{
$fieldvalue
.=
$_
;
}
$::FORM
{
$itemname
}
.=
$_
;
}
delete
$::FORM
{
""
};
# Get rid of trailing newlines.
foreach
my
$i
(
keys
%::
FORM
)
{
chomp
(
$::FORM
{
$i
});
$::FORM
{
$i
}
=~
s/\r$//
;
}
}
...
...
attachment.cgi
View file @
2b77f746
This diff is collapsed.
Click to expand it.
checksetup.pl
View file @
2b77f746
...
...
@@ -191,6 +191,7 @@ unless (have_vers("DBD::mysql","1.2209")) { push @missing,"DBD::mysql" }
unless
(
have_vers
(
"Date::Parse"
,
0
))
{
push
@missing
,
"Date::Parse"
}
unless
(
have_vers
(
"AppConfig"
,
"1.52"
))
{
push
@missing
,
"AppConfig"
}
unless
(
have_vers
(
"Template"
,
"2.01"
))
{
push
@missing
,
"Template"
}
unless
(
have_vers
(
"Text::Wrap"
,
"2001.0131"
))
{
push
@missing
,
"Text::Wrap"
}
# If CGI::Carp was loaded successfully for version checking, it changes the
# die and warn handlers, we don't want them changed, so we need to stash the
...
...
defparams.pl
View file @
2b77f746
...
...
@@ -679,4 +679,28 @@ DefParam("useattachmenttracker",
"b"
,
0
);
# The maximum size (in bytes) for patches and non-patch attachments.
# The default limit is 1000KB, which is 24KB less than mysql's default
# maximum packet size (which determines how much data can be sent in a
# single mysql packet and thus how much data can be inserted into the
# database) to provide breathing space for the data in other fields of
# the attachment record as well as any mysql packet overhead (I don't
# know of any, but I suspect there may be some.)
DefParam
(
"maxpatchsize"
,
"The maximum size (in kilobytes) of patches. Bugzilla will not
accept patches greater than this number of kilobytes in size.
To accept patches of any size (subject to the limitations of
your server software), set this value to zero."
,
"t"
,
'1000'
);
DefParam
(
"maxattachmentsize"
,
"The maximum size (in kilobytes) of non-patch attachments. Bugzilla
will not accept attachments greater than this number of kilobytes
in size. To accept attachments of any size (subject to the
limitations of your server software), set this value to zero."
,
"t"
,
'1000'
);
1
;
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