diff --git a/upload/install/include/install_function.php b/upload/install/include/install_function.php index bc68528..c1ff4da 100644 --- a/upload/install/include/install_function.php +++ b/upload/install/include/install_function.php @@ -867,7 +867,7 @@ function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ $scheme = $matches['scheme']; $host = $matches['host']; $path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : '') : '/'; - $port = !empty($matches['port']) ? $matches['port'] : 80; + $port = !empty($matches['port']) ? $matches['port'] : ($matches['scheme'] == 'https' ? 443 : 80); if(function_exists('curl_init') && $allowcurl) { $ch = curl_init(); @@ -923,7 +923,7 @@ function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ } $fpflag = 0; - if(!$fp = @fsocketopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout)) { + if(!$fp = @fsocketopen(($scheme == 'https' ? 'ssl' : $scheme).'://'.($scheme == 'https' ? $host : ($ip ? $ip : $host)), $port, $errno, $errstr, $timeout)) { $context = array( 'http' => array( 'method' => $post ? 'POST' : 'GET', @@ -933,7 +933,7 @@ function dfopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ ), ); $context = stream_context_create($context); - $fp = @fopen($scheme.'://'.($ip ? $ip : $host).':'.$port.$path, 'b', false, $context); + $fp = @fopen($scheme.'://'.($scheme == 'https' ? $host : ($ip ? $ip : $host)).':'.$port.$path, 'b', false, $context); $fpflag = 1; }