mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-02 14:57:37 +02:00
[feature/remote_upload-filesize] Also check HTTP content-length before actually starting the file transfer.
PHPBB3-9517
This commit is contained in:
committed by
Nils Adermann
parent
d19565756a
commit
e4398ef42e
@@ -802,6 +802,18 @@ class fileupload
|
|||||||
{
|
{
|
||||||
$upload_ary['type'] = rtrim(str_replace('content-type: ', '', strtolower($line)));
|
$upload_ary['type'] = rtrim(str_replace('content-type: ', '', strtolower($line)));
|
||||||
}
|
}
|
||||||
|
else if ($this->max_filesize && stripos($line, 'content-length: ') !== false)
|
||||||
|
{
|
||||||
|
$length = (int) str_replace('content-length: ', '', strtolower($line));
|
||||||
|
|
||||||
|
if ($length && $length > $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;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (stripos($line, '404 not found') !== false)
|
else if (stripos($line, '404 not found') !== false)
|
||||||
{
|
{
|
||||||
$file = new fileerror($user->lang[$this->error_prefix . 'URL_NOT_FOUND']);
|
$file = new fileerror($user->lang[$this->error_prefix . 'URL_NOT_FOUND']);
|
||||||
|
Reference in New Issue
Block a user