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
a4599dde
Commit
a4599dde
authored
Dec 08, 2011
by
Gervase Markham
Committed by
Gervase Markham
Dec 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expand max length of attachment filename from 100 to 255 characters. r=glob, a=LpSolit.
https://bugzilla.mozilla.org/show_bug.cgi?id=705078
parent
4badf488
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
Attachment.pm
Bugzilla/Attachment.pm
+5
-3
Constants.pm
Bugzilla/Constants.pm
+6
-0
Schema.pm
Bugzilla/DB/Schema.pm
+1
-1
DB.pm
Bugzilla/Install/DB.pm
+5
-1
No files found.
Bugzilla/Attachment.pm
View file @
a4599dde
...
...
@@ -581,9 +581,11 @@ sub _check_filename {
# a big deal if it munges incorrectly occasionally.
$filename
=~
s/^.*[\/\\]//
;
# Truncate the filename to 100 characters, counting from the end of the
# string to make sure we keep the filename extension.
$filename
=
substr
(
$filename
,
-
100
,
100
);
# Truncate the filename to MAX_ATTACH_FILENAME_LENGTH characters, counting
# from the end of the string to make sure we keep the filename extension.
$filename
=
substr
(
$filename
,
-
MAX_ATTACH_FILENAME_LENGTH
,
MAX_ATTACH_FILENAME_LENGTH
);
trick_taint
(
$filename
);
return
$filename
;
...
...
Bugzilla/Constants.pm
View file @
a4599dde
...
...
@@ -182,6 +182,7 @@ use Memoize;
MAX_FREETEXT_LENGTH
MAX_BUG_URL_LENGTH
MAX_POSSIBLE_DUPLICATES
MAX_ATTACH_FILENAME_LENGTH
PASSWORD_DIGEST_ALGORITHM
PASSWORD_SALT_LENGTH
...
...
@@ -563,6 +564,11 @@ use constant MAX_BUG_URL_LENGTH => 255;
# will return.
use
constant
MAX_POSSIBLE_DUPLICATES
=>
25
;
# Maximum length of filename stored in attachments table (longer ones will
# be truncated to this value). Do not increase above 255 without making the
# necessary schema changes to store longer names.
use
constant
MAX_ATTACH_FILENAME_LENGTH
=>
255
;
# This is the name of the algorithm used to hash passwords before storing
# them in the database. This can be any string that is valid to pass to
# Perl's "Digest" module. Note that if you change this, it won't take
...
...
Bugzilla/DB/Schema.pm
View file @
a4599dde
...
...
@@ -451,7 +451,7 @@ use constant ABSTRACT_SCHEMA => {
mimetype
=>
{
TYPE
=>
'TINYTEXT'
,
NOTNULL
=>
1
},
ispatch
=>
{
TYPE
=>
'BOOLEAN'
,
NOTNULL
=>
1
,
DEFAULT
=>
'FALSE'
},
filename
=>
{
TYPE
=>
'varchar(
100
)'
,
NOTNULL
=>
1
},
filename
=>
{
TYPE
=>
'varchar(
255
)'
,
NOTNULL
=>
1
},
submitter_id
=>
{
TYPE
=>
'INT3'
,
NOTNULL
=>
1
,
REFERENCES
=>
{
TABLE
=>
'profiles'
,
COLUMN
=>
'userid'
}},
...
...
Bugzilla/Install/DB.pm
View file @
a4599dde
...
...
@@ -658,6 +658,10 @@ sub update_table_definitions {
# 2011-10-11 miketosh - Bug 690173
_on_delete_set_null_for_audit_log_userid
();
# 2011-11-23 gerv@gerv.net - Bug 705058 - make filenames longer
$dbh
->
bz_alter_column
(
'attachments'
,
'filename'
,
{
TYPE
=>
'varchar(255)'
,
NOTNULL
=>
1
});
################################################################
# New --TABLE-- changes should go *** A B O V E *** this point #
...
...
@@ -2204,7 +2208,7 @@ sub _convert_attachments_filename_from_mediumtext {
# shouldn't be there for security. Buggy browsers include them,
# and attachment.cgi now takes them out, but old ones need converting.
my
$ref
=
$dbh
->
bz_column_info
(
"attachments"
,
"filename"
);
if
(
$ref
->
{
TYPE
}
ne
'varchar(100)'
)
{
if
(
$ref
->
{
TYPE
}
ne
'varchar(100)'
&&
$ref
->
{
TYPE
}
ne
'varchar(255)'
)
{
print
"Removing paths from filenames in attachments table..."
;
my
$sth
=
$dbh
->
prepare
(
"SELECT attach_id, filename FROM attachments "
.
...
...
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