commit 91af538d2a2725c98fe6199bcc9714e592403808
Author: Assos Assos <assos+forge@centrale-marseille.fr>
Date:   Wed Mar 31 23:11:57 2021 +0200

    Weekly update of contrib modules

diff --git a/drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.info b/drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.info
index fd7d87b4..c2bb0b5c 100644
--- a/drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.info
+++ b/drupal7/sites/all/modules/ldap/ldap_authentication/ldap_authentication.info
@@ -18,8 +18,8 @@ files[] = tests/ldap_authentication.test
 
 test_dependencies[] = ldap_sso:ldap_sso
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_authentication/tests/ldap_authentication.test b/drupal7/sites/all/modules/ldap/ldap_authentication/tests/ldap_authentication.test
index 1c2d2207..d8423b5a 100644
--- a/drupal7/sites/all/modules/ldap/ldap_authentication/tests/ldap_authentication.test
+++ b/drupal7/sites/all/modules/ldap/ldap_authentication/tests/ldap_authentication.test
@@ -767,8 +767,8 @@ class LdapAuthenticationTestCase extends LdapTestCase {
       'excludeIfNoAuthorizations' => [
         'property' => 'excludeIfNoAuthorizations',
         'values' => [
-          [TRUE],
-          [TRUE],
+          1,
+          1,
         ],
       ],
       'emailOption' => [
@@ -811,7 +811,7 @@ class LdapAuthenticationTestCase extends LdapTestCase {
         $property = isset($conf['property']) ? $conf['property'] : $field_name;
         $desired = isset($conf['desired_result']) ? isset($conf['desired_result'][$i]) : $conf['values'][$i];
 
-        if (is_array($desired)) {
+        if (is_array($desired) && is_array($ldap_authentication_conf_post->{$property})) {
           $success = count($desired) == count($ldap_authentication_conf_post->{$property});
         }
         else {
diff --git a/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization.info b/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization.info
index 567d7211..d2c434f2 100644
--- a/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization.info
+++ b/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization.info
@@ -20,8 +20,8 @@ configure = admin/config/people/ldap/authorization
 
 test_dependencies[] = ldap_sso:ldap_sso
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_drupal_role/ldap_authorization_drupal_role.info b/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_drupal_role/ldap_authorization_drupal_role.info
index 4e4385d0..2218d43e 100644
--- a/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_drupal_role/ldap_authorization_drupal_role.info
+++ b/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_drupal_role/ldap_authorization_drupal_role.info
@@ -9,8 +9,8 @@ files[] = LdapAuthorizationConsumerRole.class.php
 files[] = ldap_authorization_drupal_role.module
 files[] = ldap_authorization_drupal_role.inc
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php b/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php
index df2f8dc8..24b1c0d3 100644
--- a/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php
+++ b/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/LdapAuthorizationConsumerOG.class.php
@@ -190,7 +190,12 @@ class LdapAuthorizationConsumerOG extends LdapAuthorizationConsumerAbstract {
     }
 
     foreach ($gids as $entity_type => $gid_x_entity) {
-      $og_group_entities[$entity_type] = @entity_load($entity_type, $gid_x_entity);
+      if ($entity_type !== NULL) {
+        $og_group_entities[$entity_type] = @entity_load($entity_type, $gid_x_entity);
+      }
+      else {
+        watchdog("ldap_authorization_og", "Entity type of 'NULL' found while populating consumers.", WATCHDOG_ERROR);
+      }
     }
 
     foreach ($consumers as $consumer_id => $consumer) {
diff --git a/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/ldap_authorization_og.info b/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/ldap_authorization_og.info
index 5ca572fe..7c75f0df 100644
--- a/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/ldap_authorization_og.info
+++ b/drupal7/sites/all/modules/ldap/ldap_authorization/ldap_authorization_og/ldap_authorization_og.info
@@ -13,8 +13,8 @@ files[] = ldap_authorization_og.inc
 
 core = "7.x"
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_feeds/ldap_feeds.info b/drupal7/sites/all/modules/ldap/ldap_feeds/ldap_feeds.info
index 4c4c0743..247ca244 100644
--- a/drupal7/sites/all/modules/ldap/ldap_feeds/ldap_feeds.info
+++ b/drupal7/sites/all/modules/ldap/ldap_feeds/ldap_feeds.info
@@ -12,8 +12,8 @@ configure = admin/structure/feeds
 core = 7.x
 php = 5.4
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_help/ldap_help.info b/drupal7/sites/all/modules/ldap/ldap_help/ldap_help.info
index 260f7e7a..60024921 100644
--- a/drupal7/sites/all/modules/ldap/ldap_help/ldap_help.info
+++ b/drupal7/sites/all/modules/ldap/ldap_help/ldap_help.info
@@ -7,8 +7,8 @@ php = 5.4
 dependencies[] = ldap_servers
 dependencies[] = ldap_test
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_help/ldap_test_script/functions.inc b/drupal7/sites/all/modules/ldap/ldap_help/ldap_test_script/functions.inc
index 268e0370..eb9b7544 100644
--- a/drupal7/sites/all/modules/ldap/ldap_help/ldap_test_script/functions.inc
+++ b/drupal7/sites/all/modules/ldap/ldap_help/ldap_test_script/functions.inc
@@ -199,7 +199,7 @@ function ldap_help_encodePassword($password) {
   $password = "\"" . $password . "\"";
   $encoded = "";
   for ($i = 0; $i < strlen($password); $i++) {
-    $encoded .= "{$password{$i}}\000";
+    $encoded .= "{$password[$i]}\000";
   }
   return $encoded;
 }
diff --git a/drupal7/sites/all/modules/ldap/ldap_query/ldap_query.info b/drupal7/sites/all/modules/ldap/ldap_query/ldap_query.info
index e0fd27a3..2e038e94 100644
--- a/drupal7/sites/all/modules/ldap/ldap_query/ldap_query.info
+++ b/drupal7/sites/all/modules/ldap/ldap_query/ldap_query.info
@@ -18,8 +18,8 @@ files[] = tests/ldap_query.test
 
 configure = admin/config/people/ldap/query
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.functions.inc b/drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.functions.inc
index b94bedf6..d3e4d231 100644
--- a/drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.functions.inc
+++ b/drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.functions.inc
@@ -8,14 +8,15 @@
 /**
  * Modify an LDAP Entry.
  *
- * This has been depracated in favor or $ldap_server->modifyLdapEntry($dn, $attributes)
- * which handles empty attributes better.
+ * @deprecated This has been deprecated in favor of
+ * `$ldap_server->modifyLdapEntry($dn, $attributes)` which handles empty
+ * attributes better.
  */
 function ldap_user_modify($dn, $attributes, $ldap_server) {
   $result = ldap_modify($ldap_server->connection, $dn, $attributes);
   if (!$result) {
-    $error = "LDAP Server ldap_modify(%dn) in ldap_user_modify() Error Server ID = %sid, LDAP Err No: %ldap_errno LDAP Err Message: %ldap_err2str ";
-    $tokens = ['%dn' => $dn, '%sid' => $this->sid, '%ldap_errno' => ldap_errno($this->connection), '%ldap_err2str' => ldap_err2str(ldap_errno($this->connection))];
+    $error = "LDAP Server ldap_modify(%dn) in ldap_user_modify(), LDAP Err No: %ldap_errno LDAP Err Message: %ldap_err2str ";
+    $tokens = ['%dn' => $dn, '%ldap_errno' => ldap_errno($ldap_server->connection), '%ldap_err2str' => ldap_err2str(ldap_errno($ldap_server->connection))];
     watchdog('ldap_servers', $error, $tokens, WATCHDOG_ERROR);
   }
   return $result;
@@ -30,7 +31,7 @@ function ldap_password_modify($userdn, $new_password, $ldap_server) {
   $len = drupal_strlen($new_password);
   $new_pass = NULL;
   for ($i = 0; $i < $len; $i++) {
-    $new_pass .= "{$new_password{$i}}\000";
+    $new_pass .= "{$new_password[$i]}\000";
   }
 
   $status = ldap_mod_replace($ldap_server->connection, $userdn, ['unicodePwd' => $new_pass]);
@@ -416,19 +417,13 @@ function ldap_pear_unescape_dn_value($values = []) {
  * @return string
  */
 function ldap_pear_hex2asc($string) {
-
-  if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
-    $string = preg_replace_callback(
+  $string = preg_replace_callback(
     "/\\\([0-9A-Fa-f]{2})/",
     function ($m) {
       return chr(hexdec($m[1]));
     },
-        $string);
-  }
-  else {
-    $string = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $string);
-  }
-
+    $string
+  );
   return $string;
 }
 
diff --git a/drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.info b/drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.info
index a9617042..968e8595 100644
--- a/drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.info
+++ b/drupal7/sites/all/modules/ldap/ldap_servers/ldap_servers.info
@@ -18,8 +18,8 @@ files[] = ldap_servers.theme.inc
 files[] = tests/ldap_servers.test
 configure = admin/config/people/ldap/servers
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_test/ldap_test.info b/drupal7/sites/all/modules/ldap/ldap_test/ldap_test.info
index d7adb75c..063802bb 100644
--- a/drupal7/sites/all/modules/ldap/ldap_test/ldap_test.info
+++ b/drupal7/sites/all/modules/ldap/ldap_test/ldap_test.info
@@ -19,8 +19,8 @@ files[] = LdapServerTest.class.php
 files[] = LdapTestFunctions.class.php
 files[] = LdapUserTestCase.class.php
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_user/ldap_user.cron.inc b/drupal7/sites/all/modules/ldap/ldap_user/ldap_user.cron.inc
index bf351668..efd04e3f 100644
--- a/drupal7/sites/all/modules/ldap/ldap_user/ldap_user.cron.inc
+++ b/drupal7/sites/all/modules/ldap/ldap_user/ldap_user.cron.inc
@@ -52,6 +52,7 @@ function _ldap_user_orphans($ldap_user_conf) {
    *  signifying if corresponding LDAP Entry exists.
    */
   if (!(isset($result['user']) && count($result['user']) > 0)) {
+    variable_set('ldap_user_cron_last_uid_checked', 1);
     return TRUE;
   }
 
diff --git a/drupal7/sites/all/modules/ldap/ldap_user/ldap_user.info b/drupal7/sites/all/modules/ldap/ldap_user/ldap_user.info
index 58b9d078..6b6ffa3d 100644
--- a/drupal7/sites/all/modules/ldap/ldap_user/ldap_user.info
+++ b/drupal7/sites/all/modules/ldap/ldap_user/ldap_user.info
@@ -25,8 +25,8 @@ configure = admin/config/people/ldap/user
 
 test_dependencies[] = ldap_sso:ldap_sso
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_user/tests/ldap_user.test b/drupal7/sites/all/modules/ldap/ldap_user/tests/ldap_user.test
index 700d924b..89dc397b 100644
--- a/drupal7/sites/all/modules/ldap/ldap_user/tests/ldap_user.test
+++ b/drupal7/sites/all/modules/ldap/ldap_user/tests/ldap_user.test
@@ -918,7 +918,7 @@ class LdapUserIntegrationTests extends LdapTestCase {
       $email_body = $emails[count($emails) - 1]['body'];
       $result = [];
       preg_match_all('/(user\/reset\/.*)This link can only be/s', $email_body, $result, PREG_PATTERN_ORDER);
-      if (count($result == 2)) {
+      if (is_array($result) && count($result) === 2) {
         $login_path = trim($result[1][0]);
         // User login form.
         $this->drupalGet($login_path);
diff --git a/drupal7/sites/all/modules/ldap/ldap_views/ldap_views.info b/drupal7/sites/all/modules/ldap/ldap_views/ldap_views.info
index ea5d7f67..0279507a 100644
--- a/drupal7/sites/all/modules/ldap/ldap_views/ldap_views.info
+++ b/drupal7/sites/all/modules/ldap/ldap_views/ldap_views.info
@@ -23,8 +23,8 @@ files[] = handlers/ldap_views_handler_filter_attribute.inc
 files[] = handlers/ldap_views_handler_sort.inc
 files[] = handlers/ldap_views_handler_sort_attribute.inc
 
-; Information added by Drupal.org packaging script on 2019-04-20
-version = "7.x-2.5"
+; Information added by Drupal.org packaging script on 2021-03-29
+version = "7.x-2.6"
 core = "7.x"
 project = "ldap"
-datestamp = "1555751588"
+datestamp = "1617049660"
diff --git a/drupal7/sites/all/modules/ldap/ldap_views/plugins/ldap_views_plugin_query_ldap.inc b/drupal7/sites/all/modules/ldap/ldap_views/plugins/ldap_views_plugin_query_ldap.inc
index 436e8919..96257f5f 100644
--- a/drupal7/sites/all/modules/ldap/ldap_views/plugins/ldap_views_plugin_query_ldap.inc
+++ b/drupal7/sites/all/modules/ldap/ldap_views/plugins/ldap_views_plugin_query_ldap.inc
@@ -196,7 +196,16 @@ class ldap_views_plugin_query_ldap extends views_plugin_query {
     $condition     = $this->build_condition();
     $contextual    = $this->build_contextual_filter();
     $search_filter = !empty($contextual) && !empty($condition) ? '(&' . $condition . $contextual . ')' : $condition . $contextual;
-    return !empty($search_filter) ? $search_filter : $filter;
+    //if both ldap views filters & ldap views query filter exist, combine them
+    //if the ldap views filter exist, use that
+    //else, use ldap query filter
+    if (!empty($search_filter) && !empty($filter)) {
+       return '(&' . $search_filter . $filter . ')';
+    } elseif (!empty($search_filter)) {
+       return $search_filter;
+    } else {
+       return $filter;
+    }
   }
 
   /**
