Issue #2907863 by tucho, Sutharsan, Gábor Hojtsy: Prefer HTTPS protocol over HTTP when fetching translations

8.5.x
xjm 2017-11-22 16:29:01 -06:00
parent 435bae86a1
commit 1b8dea09d2
3 changed files with 14 additions and 2 deletions

View File

@ -5,7 +5,7 @@ javascript:
translation: translation:
use_source: remote_and_local use_source: remote_and_local
default_filename: '%project-%version.%language.po' default_filename: '%project-%version.%language.po'
default_server_pattern: 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po' default_server_pattern: 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po'
overwrite_customized: false overwrite_customized: false
overwrite_not_customized: true overwrite_not_customized: true
update_interval_days: 0 update_interval_days: 0

View File

@ -304,3 +304,15 @@ function locale_update_8300() {
// the new key value collection. // the new key value collection.
\Drupal::state()->delete('locale.translation_status'); \Drupal::state()->delete('locale.translation_status');
} }
/**
* Update default server pattern value to use https.
*/
function locale_update_8500() {
$update_url = \Drupal::config('locale.settings')->get('translation.default_server_pattern');
if ($update_url == 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po') {
\Drupal::configFactory()->getEditable('locale.settings')
->set('translation.default_server_pattern', 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po')
->save();
}
}

View File

@ -99,7 +99,7 @@ const LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL = 'remote_and_local';
* *
* @see locale_translation_default_translation_server(). * @see locale_translation_default_translation_server().
*/ */
const LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN = 'http://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po'; const LOCALE_TRANSLATION_DEFAULT_SERVER_PATTERN = 'https://ftp.drupal.org/files/translations/%core/%project/%project-%version.%language.po';
/** /**
* The number of seconds that the translations status entry should be considered. * The number of seconds that the translations status entry should be considered.