commit 620f9137b76bd25cff98ec1aad24a91c705b3241
Author: Assos Assos <assos+forge@centrale-marseille.fr>
Date:   Wed Mar 4 23:10:04 2020 +0100

    Weekly update of contrib modules

diff --git a/drupal7/sites/all/modules/captcha/captcha.admin.inc b/drupal7/sites/all/modules/captcha/captcha.admin.inc
index 99b19e17..36309d14 100644
--- a/drupal7/sites/all/modules/captcha/captcha.admin.inc
+++ b/drupal7/sites/all/modules/captcha/captcha.admin.inc
@@ -53,7 +53,7 @@ function captcha_admin_settings() {
   $form['captcha_form_protection'] = array(
     '#type' => 'fieldset',
     '#title' => t('Form protection'),
-    '#description' => t("Select the challenge type you want for each of the listed forms (identified by their so called <em>form_id</em>'s). You can easily add arbitrary forms with the textfield at the bottom of the table or with the help of the option <em>Add CAPTCHA administration links to forms</em> below."),
+    '#description' => t("Select the challenge type you want for each of the listed forms (identified by their so called <em>form_id</em> or <em>base_form_id</em>). You can easily add arbitrary forms with the textfield at the bottom of the table or with the help of the option <em>Add CAPTCHA administration links to forms</em> below."),
   );
   $form['captcha_form_protection']['captcha_default_challenge'] = array(
     '#type' => 'select',
@@ -454,7 +454,7 @@ function captcha_point_admin_form($form, $form_state, $captcha_point_form_id = N
     $form['captcha_point_form_id'] = array(
       '#type' => 'textfield',
       '#title' => t('Form ID'),
-      '#description' => t('The Drupal form_id of the form to add the CAPTCHA to.'),
+      '#description' => t('The Drupal form_id or base_form_id of the form to add the CAPTCHA to.'),
       '#value' => check_plain($captcha_point_form_id),
       '#disabled' => TRUE,
     );
@@ -468,7 +468,7 @@ function captcha_point_admin_form($form, $form_state, $captcha_point_form_id = N
     $form['captcha_point_form_id'] = array(
       '#type' => 'textfield',
       '#title' => t('Form ID'),
-      '#description' => t('The Drupal form_id of the form to add the CAPTCHA to.'),
+      '#description' => t('The Drupal form_id or base_form_id of the form to add the CAPTCHA to.'),
     );
   }
   // Select widget for CAPTCHA type.
diff --git a/drupal7/sites/all/modules/captcha/captcha.info b/drupal7/sites/all/modules/captcha/captcha.info
index 59eade10..533bd0e0 100644
--- a/drupal7/sites/all/modules/captcha/captcha.info
+++ b/drupal7/sites/all/modules/captcha/captcha.info
@@ -10,8 +10,8 @@ files[] = captcha.admin.inc
 files[] = captcha.install
 files[] = captcha.test
 
-; Information added by Drupal.org packaging script on 2019-10-05
-version = "7.x-1.6"
+; Information added by Drupal.org packaging script on 2020-02-21
+version = "7.x-1.7"
 core = "7.x"
 project = "captcha"
-datestamp = "1570300087"
+datestamp = "1582293280"
diff --git a/drupal7/sites/all/modules/captcha/captcha.module b/drupal7/sites/all/modules/captcha/captcha.module
index 610b6a3f..039cb4f7 100644
--- a/drupal7/sites/all/modules/captcha/captcha.module
+++ b/drupal7/sites/all/modules/captcha/captcha.module
@@ -403,6 +403,14 @@ function captcha_form_alter(&$form, &$form_state, $form_id) {
 
     // Get CAPTCHA type and module for given form_id.
     $captcha_point = captcha_get_form_id_setting($form_id);
+
+    // If no captcha point found, check to see if there is a setting for the base form id
+    if (!$captcha_point) {
+      if (isset($form_state['build_info']['base_form_id'])) {
+        $captcha_point = captcha_get_form_id_setting($form_state['build_info']['base_form_id']);
+      }
+    }
+
     if ($captcha_point && !empty($captcha_point->captcha_type)) {
       module_load_include('inc', 'captcha');
       // Build CAPTCHA form element.
diff --git a/drupal7/sites/all/modules/captcha/image_captcha/image_captcha.info b/drupal7/sites/all/modules/captcha/image_captcha/image_captcha.info
index 93ed966c..80689816 100644
--- a/drupal7/sites/all/modules/captcha/image_captcha/image_captcha.info
+++ b/drupal7/sites/all/modules/captcha/image_captcha/image_captcha.info
@@ -11,8 +11,8 @@ files[] = image_captcha.admin.inc
 files[] = image_captcha.user.inc
 files[] = image_captcha.test
 
-; Information added by Drupal.org packaging script on 2019-10-05
-version = "7.x-1.6"
+; Information added by Drupal.org packaging script on 2020-02-21
+version = "7.x-1.7"
 core = "7.x"
 project = "captcha"
-datestamp = "1570300087"
+datestamp = "1582293280"
diff --git a/drupal7/sites/all/modules/l10n_update/l10n_update.admin.inc b/drupal7/sites/all/modules/l10n_update/l10n_update.admin.inc
index f196478a..845621e0 100644
--- a/drupal7/sites/all/modules/l10n_update/l10n_update.admin.inc
+++ b/drupal7/sites/all/modules/l10n_update/l10n_update.admin.inc
@@ -202,7 +202,11 @@ function l10n_update_admin_settings_form($form, &$form_state) {
     '#default_value' => variable_get('l10n_update_download_store', ''),
     '#description' => t('A path relative to the Drupal installation directory where translation files will be stored, e.g. sites/all/translations. Saved translation files can be reused by other installations. If left empty the downloaded translation will not be saved.'),
   );
-  return system_settings_form($form);
+
+  $form = system_settings_form($form);
+  $form['#submit'][] = 'l10n_update_admin_settings_form_submit';
+
+  return $form;
 }
 
 /**
@@ -220,6 +224,14 @@ function l10n_update_admin_settings_form_validate($form, &$form_state) {
   }
 }
 
+/**
+ * Additional submit handler for update settings.
+ */
+function l10n_update_admin_settings_form_submit($form, &$form_state) {
+  // Add .htaccess file to the translations directory.
+  l10n_update_ensure_htaccess();
+}
+
 /**
  * Get array of import options.
  *
diff --git a/drupal7/sites/all/modules/l10n_update/l10n_update.info b/drupal7/sites/all/modules/l10n_update/l10n_update.info
index f74cf59c..52a667e5 100644
--- a/drupal7/sites/all/modules/l10n_update/l10n_update.info
+++ b/drupal7/sites/all/modules/l10n_update/l10n_update.info
@@ -6,9 +6,8 @@ package = Multilingual
 
 files[] = l10n_update.parser.inc
 
-; Information added by Drupal.org packaging script on 2014-11-10
-version = "7.x-1.1"
+; Information added by Drupal.org packaging script on 2019-12-16
+version = "7.x-1.4"
 core = "7.x"
 project = "l10n_update"
-datestamp = "1415605322"
-
+datestamp = "1576494267"
diff --git a/drupal7/sites/all/modules/l10n_update/l10n_update.install b/drupal7/sites/all/modules/l10n_update/l10n_update.install
index 3acfad67..ecbefdfb 100644
--- a/drupal7/sites/all/modules/l10n_update/l10n_update.install
+++ b/drupal7/sites/all/modules/l10n_update/l10n_update.install
@@ -15,7 +15,7 @@ function l10n_update_schema() {
       'name' => array(
         'description' => 'A unique short name to identify the project.',
         'type' => 'varchar',
-        'length' => '50',
+        'length' => '255',
         'not null' => TRUE,
       ),
       'project_type' => array(
@@ -68,7 +68,7 @@ function l10n_update_schema() {
       'project' => array(
         'description' => 'A unique short name to identify the project.',
         'type' => 'varchar',
-        'length' => '50',
+        'length' => '255',
         'not null' => TRUE,
       ),
       'language' => array(
@@ -207,6 +207,27 @@ function l10n_update_requirements($phase) {
       $requirements['l10n_update']['value'] = t('Not enabled');
       $requirements['l10n_update']['severity'] = REQUIREMENT_INFO;
     }
+
+    // Test the contents of the .htaccess file in the translations directory.
+    $directory = variable_get('l10n_update_download_store', '');
+    if ($directory) {
+      l10n_update_ensure_htaccess();
+      $htaccess_file = $directory . '/.htaccess';
+      // Check for the string which was added to the recommended .htaccess file
+      // in the latest security update.
+      if (!file_exists($htaccess_file) || !($contents = @file_get_contents($htaccess_file)) || strpos($contents, 'Drupal_Security_Do_Not_Remove_See_SA_2013_003') === FALSE) {
+        $requirements['l10n_update_htaccess'] = array(
+          'title' => t('Translations directory'),
+          'value' => t('Not fully protected'),
+          'severity' => REQUIREMENT_ERROR,
+          'description' => t('See <a href="@url">@url</a> for information about the recommended .htaccess file which should be added to the %directory directory to help protect against arbitrary code execution.', array(
+            '@url' => 'http://drupal.org/SA-CORE-2013-003',
+            '%directory' => $directory
+          )),
+        );
+      }
+    }
+
     return $requirements;
   }
   // We must always return array, the installer doesn't use module_invoke_all()
@@ -297,3 +318,36 @@ function l10n_update_update_7005() {
 function l10n_update_update_7006() {
   registry_rebuild();
 }
+
+/**
+ * Increase the length of the {l10n_update_project}.name column.
+ */
+function l10n_update_update_7007() {
+  $schema = l10n_update_schema();
+  db_change_field('l10n_update_project', 'name', 'name', $schema['l10n_update_project']['fields']['name']);
+}
+
+/**
+ * Increase the length of the {l10n_update_file}.project column.
+ */
+function l10n_update_update_7008() {
+  $schema = l10n_update_schema();
+  db_change_field('l10n_update_file', 'project', 'project', $schema['l10n_update_file']['fields']['project']);
+}
+
+/**
+ * Remove 'headers' field from cache table.
+ */
+function l10n_update_update_7009() {
+  if (db_field_exists('cache_l10n_update', 'headers')) {
+    db_drop_field('cache_l10n_update', 'headers');
+  }
+}
+
+/**
+ * Add a .htaccess file to the translations directory.
+ */
+function l10n_update_update_7010() {
+  module_load_include('module', 'l10n_update');
+  l10n_update_ensure_htaccess();
+}
diff --git a/drupal7/sites/all/modules/l10n_update/l10n_update.module b/drupal7/sites/all/modules/l10n_update/l10n_update.module
index 0ec2a8ce..0027d805 100644
--- a/drupal7/sites/all/modules/l10n_update/l10n_update.module
+++ b/drupal7/sites/all/modules/l10n_update/l10n_update.module
@@ -494,3 +494,13 @@ function l10n_update_flush_caches() {
   }
   return array();
 }
+
+/**
+ * Creates a .htaccess file in the translations directory if it is missing.
+ */
+function l10n_update_ensure_htaccess() {
+  $directory = variable_get('l10n_update_download_store', '');
+  if ($directory) {
+    file_create_htaccess($directory, FALSE);
+  }
+}
diff --git a/drupal7/sites/all/modules/l10n_update/l10n_update.project.inc b/drupal7/sites/all/modules/l10n_update/l10n_update.project.inc
index f0129703..a4642514 100644
--- a/drupal7/sites/all/modules/l10n_update/l10n_update.project.inc
+++ b/drupal7/sites/all/modules/l10n_update/l10n_update.project.inc
@@ -47,42 +47,18 @@ function l10n_update_build_projects($refresh = FALSE) {
 
   $default_server = l10n_update_default_server();
 
-  if (module_exists('update')) {
-    $projects_info = update_get_available(TRUE);
-  }
   foreach ($projects as $name => $data) {
-
-    // Force update fetch of project data in cases where Drupal's performance
-    // optimized approach is missing out on some projects.
-    // @see http://drupal.org/node/1671570#comment-6216090
-    if (module_exists('update') && !isset($projects_info[$name])) {
-      module_load_include('fetch.inc', 'update');
-      _update_process_fetch_task($data);
-      $available = _update_get_cached_available_releases();
-      if (!empty($available[$name])) {
-        $projects_info[$name] = $available[$name];
-      }
-    }
-
-    if (isset($projects_info[$name]['releases']) && $projects_info[$name]['project_status'] != 'not-fetched') {
-      // Find out if a dev version is installed.
-      if (preg_match("/^[0-9]+\.x-([0-9]+)\..*-dev$/", $data['info']['version'], $matches)) {
-        // Find a suitable release to use as alternative translation.
-        foreach ($projects_info[$name]['releases'] as $project_release) {
-          // The first release with the same major release number which is not
-          // a dev release is the one. Releases are sorted the most recent first.
-          if ($project_release['version_major'] == $matches[1] &&
-              (!isset($project_release['version_extra']) || $project_release['version_extra'] != 'dev')) {
-            $release = $project_release;
-            break;
-          }
-        }
+    // For dev releases, remove the '-dev' part and trust the translation server
+    // to fall back to the latest stable release for that branch.
+    if (isset($data['info']['version']) && strpos($data['info']['version'], '-dev')) {
+      if (preg_match("/^(\d+\.x-\d+\.).*$/", $data['info']['version'], $matches)) {
+        // Example matches: 7.x-1.x-dev, 7.x-1.0-alpha1+5-dev => 7.x-1.x
+        $data['info']['version'] = $matches[1] . 'x';
       }
-      if (!empty($release['version'])) {
-        $data['info']['version'] = $release['version'];
+      elseif (preg_match("/^(\d+\.).*$/", $data['info']['version'], $matches)) {
+        // Example match: 7.33-dev => 7.x (Drupal core)
+        $data['info']['version'] = $matches[1] . 'x';
       }
-
-      unset($release);
     }
 
     $data += array(
@@ -228,7 +204,7 @@ function _l10n_update_project_info_list(&$projects, $list, $project_type, $disab
         'name' => $project_name,
         'info' => $file->info,
         'datestamp' => isset($file->info['datestamp']) ? $file->info['datestamp'] : 0,
-        'includes' => array($file->name => $file->info['name']),
+        'includes' => array($file->name => isset($file->info['name']) ? $file->info['name'] : $file->name),
         'project_type' => $project_name == 'drupal' ? 'core' : $project_type,
       );
     }
