mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
Merge pull request #4141 from exussum12/ticket/14431-3.1
[ticket/14431] Remote avatar uploading
This commit is contained in:
commit
f2f9ce544f
1 changed files with 11 additions and 2 deletions
|
@ -776,9 +776,18 @@ class fileupload
|
||||||
|
|
||||||
$url = parse_url($upload_url);
|
$url = parse_url($upload_url);
|
||||||
|
|
||||||
|
$default_port = 80;
|
||||||
|
$hostname = $url['host'];
|
||||||
|
|
||||||
|
if ($url['scheme'] == 'https')
|
||||||
|
{
|
||||||
|
$default_port = 443;
|
||||||
|
$hostname = 'tls://' . $url['host'];
|
||||||
|
}
|
||||||
|
|
||||||
$host = $url['host'];
|
$host = $url['host'];
|
||||||
$path = $url['path'];
|
$path = $url['path'];
|
||||||
$port = (!empty($url['port'])) ? (int) $url['port'] : 80;
|
$port = (!empty($url['port'])) ? (int) $url['port'] : $default_port;
|
||||||
|
|
||||||
$upload_ary['type'] = 'application/octet-stream';
|
$upload_ary['type'] = 'application/octet-stream';
|
||||||
|
|
||||||
|
@ -818,7 +827,7 @@ class fileupload
|
||||||
$errno = 0;
|
$errno = 0;
|
||||||
$errstr = '';
|
$errstr = '';
|
||||||
|
|
||||||
if (!($fsock = @fsockopen($host, $port, $errno, $errstr)))
|
if (!($fsock = @fsockopen($hostname, $port, $errno, $errstr)))
|
||||||
{
|
{
|
||||||
$file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']);
|
$file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']);
|
||||||
return $file;
|
return $file;
|
||||||
|
|
Loading…
Add table
Reference in a new issue