mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/14431] Remote avatar uploading
Fixed content length bug Ran composer update PHPBB3-14431
This commit is contained in:
committed by
Marc Alexander
parent
cec63974c3
commit
49dd9f0219
@@ -115,13 +115,19 @@ class remote extends base
|
||||
return $this->factory->get('filespec')->set_error($this->language->lang($this->upload->error_prefix . 'NOT_UPLOADED'));
|
||||
}
|
||||
|
||||
if ($remote_max_filesize && $response->getContentType() > $remote_max_filesize)
|
||||
$content_length = $response->getContentLength();
|
||||
if ($remote_max_filesize && $content_length > $remote_max_filesize)
|
||||
{
|
||||
$max_filesize = get_formatted_filesize($remote_max_filesize, false);
|
||||
|
||||
return $this->factory->get('filespec')->set_error($this->language->lang($this->upload->error_prefix . 'WRONG_FILESIZE', $max_filesize['value'], $max_filesize['unit']));
|
||||
}
|
||||
|
||||
if ($content_length == 0)
|
||||
{
|
||||
return $this->factory->get('filespec')->set_error($this->upload->error_prefix . 'EMPTY_REMOTE_DATA');
|
||||
}
|
||||
|
||||
$data = $response->getBody();
|
||||
|
||||
$filename = tempnam(sys_get_temp_dir(), unique_id() . '-');
|
||||
|
Reference in New Issue
Block a user