Permalink
Browse files

Merge pull request #1559 from oc666/29374

add support for redirect on installer helper
  • Loading branch information...
2 parents 252cf7d + 2a1771e commit 37977490f5703d5030ee3ffa746bfe062294b31b @pasamio pasamio committed Oct 4, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 libraries/joomla/installer/helper.php
@@ -46,13 +46,17 @@ public static function downloadPackage($url, $target = false)
$http = JHttpFactory::getHttp();
$response = $http->get($url);
- if (200 != $response->code)
+ if (302 == $response->code && isset($response->headers['Location']))
+ {
+ return self::downloadPackage($response->headers['Location']);
+ }
+ elseif (200 != $response->code)
{
JLog::add(JText::_('JLIB_INSTALLER_ERROR_DOWNLOAD_SERVER_CONNECT'), JLog::WARNING, 'jerror');
return false;
}
- if ($response->headers['wrapper_data']['Content-Disposition'])
+ if (isset($response->headers['wrapper_data']['Content-Disposition']))
{
$contentfilename = explode("\"", $response->headers['wrapper_data']['Content-Disposition']);
$target = $contentfilename[1];

0 comments on commit 3797749

Please sign in to comment.