diff --git a/core/modules/locale/config/install/locale.settings.yml b/core/modules/locale/config/install/locale.settings.yml index 857a36935172..a6cd4f30439d 100644 --- a/core/modules/locale/config/install/locale.settings.yml +++ b/core/modules/locale/config/install/locale.settings.yml @@ -5,7 +5,7 @@ javascript: translation: use_source: remote_and_local 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_not_customized: true update_interval_days: 0 diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install index f85b8599f9e5..4c49c3c1bcfb 100644 --- a/core/modules/locale/locale.install +++ b/core/modules/locale/locale.install @@ -304,3 +304,15 @@ function locale_update_8300() { // the new key value collection. \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(); + } +} diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index b1298e4b679e..9e424484b80e 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -99,7 +99,7 @@ const LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL = 'remote_and_local'; * * @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.