aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-02-03 10:31:56 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-02-03 10:31:56 +0100
commit013d4d463392ca70106d9a3e8597e05f8e9a09ff (patch)
tree37e7cbabd1a5ddd4c564cdf171dc76631c5958ae /phpBB/phpbb/files
parentMerge pull request #4017 from CHItA/ticket/14262 (diff)
parentMerge pull request #4141 from exussum12/ticket/14431-3.1 (diff)
downloadphpbb-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.php13
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'));
}