diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-02-03 10:29:39 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-02-03 10:29:39 +0100 |
commit | f2f9ce544fa166449e261c1b7d12135dc6d58cb4 (patch) | |
tree | 8260ca75edf2a1494bd00808a3b4c3657375e4ac /phpBB | |
parent | 89a34ff033b4b2cc854c79556bb75cd235c86509 (diff) | |
parent | 366a92c36ae988706565e1fa02f8808a0241e916 (diff) | |
download | forums-f2f9ce544fa166449e261c1b7d12135dc6d58cb4.tar forums-f2f9ce544fa166449e261c1b7d12135dc6d58cb4.tar.gz forums-f2f9ce544fa166449e261c1b7d12135dc6d58cb4.tar.bz2 forums-f2f9ce544fa166449e261c1b7d12135dc6d58cb4.tar.xz forums-f2f9ce544fa166449e261c1b7d12135dc6d58cb4.zip |
Merge pull request #4141 from exussum12/ticket/14431-3.1
[ticket/14431] Remote avatar uploading
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_upload.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index f0a48e51e5..1aac0e803c 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -776,9 +776,18 @@ class fileupload $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']; $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'; @@ -818,7 +827,7 @@ class fileupload $errno = 0; $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']); return $file; |