diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-02-03 10:31:56 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-02-03 10:31:56 +0100 |
commit | 013d4d463392ca70106d9a3e8597e05f8e9a09ff (patch) | |
tree | 37e7cbabd1a5ddd4c564cdf171dc76631c5958ae /phpBB/phpbb/files | |
parent | Merge pull request #4017 from CHItA/ticket/14262 (diff) | |
parent | Merge pull request #4141 from exussum12/ticket/14431-3.1 (diff) | |
download | phpbb-013d4d463392ca70106d9a3e8597e05f8e9a09ff.tar.gz phpbb-013d4d463392ca70106d9a3e8597e05f8e9a09ff.tar.bz2 phpbb-013d4d463392ca70106d9a3e8597e05f8e9a09ff.zip |
Merge branch '3.1.x'
Conflicts:
phpBB/includes/functions_upload.php
Diffstat (limited to 'phpBB/phpbb/files')
-rw-r--r-- | phpBB/phpbb/files/types/remote.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/phpBB/phpbb/files/types/remote.php b/phpBB/phpbb/files/types/remote.php index 33cbfb00ae..d311face98 100644 --- a/phpBB/phpbb/files/types/remote.php +++ b/phpBB/phpbb/files/types/remote.php @@ -86,9 +86,18 @@ class remote extends base $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'; @@ -104,7 +113,7 @@ class remote extends base $errno = 0; $errstr = ''; - if (!($fsock = @fsockopen($host, $port, $errno, $errstr))) + if (!($fsock = @fsockopen($hostname, $port, $errno, $errstr))) { return $this->factory->get('filespec')->set_error($this->language->lang($this->upload->error_prefix . 'NOT_UPLOADED')); } |