From 17493b7f112efe097ef4ce6953a77edaa81c3a5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 17 Jun 2013 14:38:30 +0200 Subject: [PATCH] Use the URL provided by the package server when downloading packages --- .../PackageInstallationScheduler.class.php | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php index 0a55a75481..ecfd6c0007 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php @@ -215,15 +215,23 @@ class PackageInstallationScheduler { // get auth data $authData = $this->getAuthData($packageUpdateVersion); - // create request - $request = new HTTPRequest( - $this->packageUpdateServers[$packageUpdateVersion['packageUpdateServerID']]->serverURL, - (!empty($authData) ? array('auth' => $authData) : array()), - array( - 'packageName' => $packageUpdateVersion['package'], - 'packageVersion' => $packageUpdateVersion['packageVersion'] - ) - ); + if ($packageUpdateVersion['filename']) { + $request = new HTTPRequest( + $packageUpdateVersion['filename'], + (!empty($authData) ? array('auth' => $authData) : array()) + ); + } + else { + // create request + $request = new HTTPRequest( + $this->packageUpdateServers[$packageUpdateVersion['packageUpdateServerID']]->serverURL, + (!empty($authData) ? array('auth' => $authData) : array()), + array( + 'packageName' => $packageUpdateVersion['package'], + 'packageVersion' => $packageUpdateVersion['packageVersion'] + ) + ); + } try { $request->execute(); -- 2.20.1