File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
wcfsetup/install/files/lib/system/file/processor Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 3636final class FileProcessor extends SingletonFactory
3737{
3838 public const MAXIMUM_NUMBER_OF_CHUNKS = 255 ;
39+ public const MAXIMUM_CHUNK_SIZE = 99_000_000 ;
3940
4041 /**
4142 * @var array<string, ObjectType>
@@ -361,11 +362,13 @@ public function getOptimalChunkSize(): int
361362 {
362363 $ postMaxSize = \ini_parse_quantity (\ini_get ('post_max_size ' ));
363364 if ($ postMaxSize === 0 ) {
364- // Disabling it is fishy, assume a more reasonable limit of 100 MB.
365- $ postMaxSize = 100_000_000 ;
365+ // Disabling it is fishy, assume a more reasonable limit of 99 MB.
366+ return self :: MAXIMUM_CHUNK_SIZE ;
366367 }
367368
368- return $ postMaxSize ;
369+ // 99 MB is a reasonable upper limit that also plays nice with services
370+ // like Cloudflare that usually come with a 100 MB request limit.
371+ return \min (self ::MAXIMUM_CHUNK_SIZE , $ postMaxSize );
369372 }
370373
371374 public function getMaximumFileSize (): int
You can’t perform that action at this time.
0 commit comments