Commit 38f2c426 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 399074: Remove the 'maxpatchsize' parameter - Patch by Fré©ric Buclin…

Bug 399074: Remove the 'maxpatchsize' parameter - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent e087aa60
......@@ -474,9 +474,7 @@ sub _validate_filename {
sub _validate_data {
my ($throw_error, $hr_vars) = @_;
my $cgi = Bugzilla->cgi;
my $maxsize = $cgi->param('ispatch') ? Bugzilla->params->{'maxpatchsize'}
: Bugzilla->params->{'maxattachmentsize'};
$maxsize *= 1024; # Convert from K
my $fh;
# Skip uploading into a local variable if the user wants to upload huge
# attachments into local files.
......@@ -514,6 +512,7 @@ sub _validate_data {
}
# Make sure the attachment does not exceed the maximum permitted size
my $maxsize = Bugzilla->params->{'maxattachmentsize'} * 1024; # Convert from K
my $len = $data ? length($data) : 0;
if ($maxsize && $len > $maxsize) {
my $vars = { filesize => sprintf("%.0f", $len/1024) };
......
......@@ -50,12 +50,6 @@ sub get_param_list {
type => 'b',
default => 0
},
{
name => 'maxpatchsize',
type => 't',
default => '1000',
checker => \&check_numeric
},
{
name => 'maxattachmentsize',
......
......@@ -31,12 +31,7 @@
"specify a URL when creating an attachment and " _
"treat the URL itself as if it were an attachment.",
maxpatchsize => "The maximum size (in kilobytes) of patches. $terms.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.",
maxattachmentsize => "The maximum size (in kilobytes) of non-patch attachments. " _
maxattachmentsize => "The maximum size (in kilobytes) of attachments. " _
"$terms.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 " _
......
......@@ -1258,7 +1258,7 @@
[% title = "File Too Large" %]
The file you are trying to attach is [% filesize FILTER html %]
kilobytes (KB) in size.
Patches cannot be more than [% Param('maxpatchsize') %] KB in size.
Patches cannot be more than [% Param('maxattachmentsize') %] KB in size.
Try splitting your patch into several pieces.
[% ELSIF error == "product_access_denied" %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment