mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00: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:
parent
925a135613
commit
d19565756a
1 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue