mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[feature/remote_upload-filesize] When transferring files from a remote webserver, abort the transfer as soon as the allowed filesize has been exceeded.
PHPBB3-9517
This commit is contained in:
committed by
Nils Adermann
parent
925a135613
commit
d19565756a
@@ -775,7 +775,18 @@ class fileupload
|
||||
{
|
||||
if ($get_info)
|
||||
{
|
||||
$data .= @fread($fsock, 1024);
|
||||
$block = @fread($fsock, 1024);
|
||||
$filesize += strlen($block);
|
||||
|
||||
if ($this->max_filesize && $filesize > $this->max_filesize)
|
||||
{
|
||||
$max_filesize = get_formatted_filesize($this->max_filesize, false);
|
||||
|
||||
$file = new fileerror(sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']));
|
||||
return $file;
|
||||
}
|
||||
|
||||
$data .= $block;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user