This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

add support for redirect on installer helper

  • Loading branch information...
oc666 committed Sep 29, 2012
1 parent d50fe07 commit 43db70f98f368344245101cb736437f4e680cfae
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']);
+ }
+ else if (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 43db70f

Please sign in to comment.