commit 5effc1c728f35ba42f7f6de531ce19d984f04835 Author: Erik Stielstra Date: Sat Dec 29 12:00:29 2012 +0100 #5 diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc index 3a58fe7..a8be3d7 100644 --- a/core/modules/locale/locale.batch.inc +++ b/core/modules/locale/locale.batch.inc @@ -43,6 +43,7 @@ function locale_translation_batch_status_fetch_remote($source, &$context) { // store the resulting uri. If a file is not found we don't update the // file object, and store it unchanged. if (isset($result['last_modified'])) { + $remote_file->uri = isset($result['location']) ? $result['location'] : $remote_file->uri; $remote_file->timestamp = $result['last_modified']; $source->files[LOCALE_TRANSLATION_REMOTE] = $remote_file; } @@ -444,9 +445,17 @@ function locale_translation_http_check($uri) { $request = drupal_container()->get('http_default_client')->head($uri); try { $response = $request->send(); - return array( - 'last_modified' => $response->getLastModified() ? strtotime($response->getLastModified()) : 0, - ); + $result = array(); + + // In case of a redirected response, return the last file location. + if ($previous = $response->getPreviousResponse()) { + if ($previous->isRedirect()) { + $result['location'] = $previous->getLocation(); + } + } + + $result['last_modified'] = $response->getLastModified() ? strtotime($response->getLastModified()) : 0; + return $result; } catch (BadResponseException $e) { if ($response = $e->getResponse()) {