From: Tim Düsterhus Date: Fri, 18 May 2012 18:34:31 +0000 (+0200) Subject: Fixing downloadFileFromHTTP X-Git-Tag: 2.0.0_Beta_1~1101^2~3^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=31e71c9b95ed9a642910c5e6ffc211bef1e9fa8c;p=GitHub%2FWoltLab%2FWCF.git Fixing downloadFileFromHTTP --- diff --git a/wcfsetup/install/files/lib/util/FileUtil.class.php b/wcfsetup/install/files/lib/util/FileUtil.class.php index 0bfdf21f5b..c0753930ee 100644 --- a/wcfsetup/install/files/lib/util/FileUtil.class.php +++ b/wcfsetup/install/files/lib/util/FileUtil.class.php @@ -395,10 +395,10 @@ final class FileUtil { * @param string $prefix * @param array $options * @param array $postParameters - * @param array $headers Should be either an empty array or a not initialized variable. - * @return string path to the dowloaded file + * @param array $headers Should be either an empty array or a not initialized variable. + * @return string path to the downloaded file */ - public static function downloadFileFromHttp($httpUrl, $prefix = 'package', array $options = array(), array $postParameters = array(), array &$headers = array()) { + public static function downloadFileFromHttp($httpUrl, $prefix = 'package', array $options = array(), array $postParameters = array(), &$headers = array()) { $newFileName = self::getTemporaryFilename($prefix.'_'); $localFile = new File($newFileName); // the file to write. @@ -452,13 +452,13 @@ final class FileUtil { $request .= "User-Agent: HTTP.PHP (FileUtil.class.php; WoltLab Community Framework/".WCF_VERSION."; ".WCF::getLanguage()->languageCode.")\r\n"; $request .= "Accept: */*\r\n"; $request .= "Accept-Language: ".WCF::getLanguage()->languageCode."\r\n"; - if ($method !== 'GET') { + if ($options['method'] !== 'GET') { $request .= "Content-length: ".strlen($parameterString)."\r\n"; $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; } $request .= "Host: ".$host."\r\n"; $request .= "Connection: Close\r\n\r\n"; - if ($method !== 'GET') $request .= $parameterString."\r\n\r\n"; + if ($options['method'] !== 'GET') $request .= $parameterString."\r\n\r\n"; $remoteFile->puts($request); $inHeader = true;