- Merge pull request #8 from wbb3addons/downloadFileUndefinedVar
authorAlexander Ebert <ebert@woltlab.com>
Thu, 14 Jul 2011 20:35:57 +0000 (22:35 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 14 Jul 2011 20:35:57 +0000 (22:35 +0200)
wcfsetup/install/files/lib/util/FileUtil.class.php

index 80e253c3c61a4ca579e377cc21446c9a62e536a5..3d255f97e8b4505aee3b5f746682f4bd42a473a0 100644 (file)
@@ -365,12 +365,12 @@ class FileUtil {
                }\r
                // if allow_url_fopen isn't active, we attempt to use our own http download functionality.\r
                else {\r
+                       $port = 80;\r
                        $parsedUrl = parse_url($httpUrl);\r
-                       $port = ($parsedUrl['scheme'] == 'https' ? 443 : 80);\r
                        $host = $parsedUrl['host'];\r
-                       $path = $parsedUrl['path'];\r
-\r
-                       $remoteFile = new RemoteFile(($parsedUrl['scheme'] == 'https' ? 'ssl://' : '').$host, $port, 30, $options); // the file to read.\r
+                       $path = (isset($parsedUrl['path']) ? $parsedUrl['path'] : '/');\r
+                       \r
+                       $remoteFile = new RemoteFile($host, $port, 30, $options); // the file to read.\r
                        if (!isset($remoteFile)) {\r
                                $localFile->close();\r
                                unlink($newFileName);\r
@@ -565,3 +565,4 @@ class FileUtil {
                return function_exists('apache_get_version');\r
        }\r
 }
+?>\r