From: Alexander Ebert Date: Thu, 14 Jul 2011 20:35:57 +0000 (+0200) Subject: - Merge pull request #8 from wbb3addons/downloadFileUndefinedVar X-Git-Tag: 2.0.0_Beta_1~2034 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=71dab8ee7e779a02483841c41580acd368a1d063;p=GitHub%2FWoltLab%2FWCF.git - Merge pull request #8 from wbb3addons/downloadFileUndefinedVar --- diff --git a/wcfsetup/install/files/lib/util/FileUtil.class.php b/wcfsetup/install/files/lib/util/FileUtil.class.php index 80e253c3c6..3d255f97e8 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(($parsedUrl['scheme'] == 'https' ? 'ssl://' : '').$host, $port, 30, $options); // the file to read. + $path = (isset($parsedUrl['path']) ? $parsedUrl['path'] : '/'); + + $remoteFile = new RemoteFile($host, $port, 30, $options); // the file to read. if (!isset($remoteFile)) { $localFile->close(); unlink($newFileName); @@ -565,3 +565,4 @@ class FileUtil { return function_exists('apache_get_version'); } } +?>