From 288ced58d0720b89103af95b5820f9ef4f91ebc1 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <machniak@kolabsys.com>
Date: Fri, 2 Aug 2019 08:18:30 +0200
Subject: [PATCH] Fix wrong implode() parameter order, it would throw a warning
 on PHP 7.4.

---
 lib/Net/LDAP3.php | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php
index ef47daa..1ba541d 100644
--- a/lib/Net/LDAP3.php
+++ b/lib/Net/LDAP3.php
@@ -1831,7 +1831,7 @@ class Net_LDAP3
                     $val          = self::quote_string($val);
                     $val_filter[] = "(" . $field . $operator . $prefix . $val . $suffix . ")";
                 }
-                $filter .= "(|" . implode($val_filter, '') . ")";
+                $filter .= "(|" . implode($val_filter) . ")";
             }
             else {
                 $value = self::quote_string($value);
@@ -2373,9 +2373,9 @@ class Net_LDAP3
                 }
                 else {
                     $old_parent_dn_components = ldap_explode_dn($olddn, 0);
-                    unset($old_parent_dn_components["count"]);
+                    unset($old_parent_dn_components['count']);
                     $old_rdn       = array_shift($old_parent_dn_components);
-                    $old_parent_dn = implode(",", $old_parent_dn_components);
+                    $old_parent_dn = implode(',', $old_parent_dn_components);
                     $subject_dn    = $newrdn . ',' . $old_parent_dn;
                 }
 
@@ -2442,10 +2442,9 @@ class Net_LDAP3
 
     protected function parse_aclrights(&$attributes, $attribute_value)
     {
-        $components = explode(':', $attribute_value);
-        $_acl_target = array_shift($components);
-        $_acl_value = trim(implode(':', $components));
-
+        $components      = explode(':', $attribute_value);
+        $_acl_target     = array_shift($components);
+        $_acl_value      = trim(implode(':', $components));
         $_acl_components = explode(';', $_acl_target);
 
         switch ($_acl_components[1]) {
-- 
GitLab