]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 399074: Remove the 'maxpatchsize' parameter - Patch by Frédéric Buclin <LpSolit...
authorlpsolit%gmail.com <>
Wed, 10 Dec 2008 18:32:27 +0000 (18:32 +0000)
committerlpsolit%gmail.com <>
Wed, 10 Dec 2008 18:32:27 +0000 (18:32 +0000)
Bugzilla/Attachment.pm
Bugzilla/Config/Attachment.pm
template/en/default/admin/params/attachment.html.tmpl
template/en/default/global/user-error.html.tmpl

index 3582ffb2304ccf0c8dfc87ffdc1221940c79d448..4aa74dcdfe308d08e1b8fb16a50dce35bf2aa129 100644 (file)
@@ -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) };
index bbaaaa63d4813ca8d7a4817972021c717d4cdcbb..72ad29a2de3540507e0effe23f3dc498364986b5 100644 (file)
@@ -50,12 +50,6 @@ sub get_param_list {
   type => 'b',
   default => 0
   },
-  {
-   name => 'maxpatchsize',
-   type => 't',
-   default => '1000',
-   checker => \&check_numeric
-  },
 
   {
    name => 'maxattachmentsize',
index 132f971c0954e1b8441008afba7c5c6bc4522e94..ef3363bbb494c80be5935a1f5f22ee08c4a0aacd 100644 (file)
                       "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 " _
index 0b10b73965f30d8c75252f4765fd83b08b80967d..8969b9d30e055094d3d240b653b2e82163ac9b18 100644 (file)
     [% 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" %]