From 361049b451066d3d6607afc40a40a7a290a68db6 Mon Sep 17 00:00:00 2001 From: TimWolla Date: Thu, 14 Jul 2011 19:43:09 +0200 Subject: [PATCH] FileUtil::downloadFileFromHttp supports now https-URLs Tested with both the fopen and fsockopen way --- wcfsetup/install/files/lib/util/FileUtil.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/util/FileUtil.class.php b/wcfsetup/install/files/lib/util/FileUtil.class.php index 1aa3507c00..56914e922a 100644 --- a/wcfsetup/install/files/lib/util/FileUtil.class.php +++ b/wcfsetup/install/files/lib/util/FileUtil.class.php @@ -365,12 +365,12 @@ class FileUtil { } // if allow_url_fopen isn't active, we attempt to use our own http download functionality. else { - $port = 80; $parsedUrl = parse_url($httpUrl); + $port = ($parsedUrl['scheme'] == 'https' ? 443 : 80); $host = $parsedUrl['host']; $path = $parsedUrl['path']; - - $remoteFile = new RemoteFile($host, $port, 30, $options); // the file to read. + + $remoteFile = new RemoteFile(($parsedUrl['scheme'] == 'https' ? 'ssl://' : '').$host, $port, 30, $options); // the file to read. if (!isset($remoteFile)) { $localFile->close(); unlink($newFileName); -- 2.20.1